Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/filestore: disable use of splice by default #11113

Merged
merged 1 commit into from Sep 28, 2016

Conversation

yuyuyu101
Copy link
Member

@yuyuyu101 yuyuyu101 commented Sep 17, 2016

  1. currently splice is actually buggy whatever enabling or not fiemap/seek_data feature
  2. like bluestore's clone_range(a931dd3) we need to zero target file when source file exist hole, but filestore's zero op maybe heavy which not equal to bluestore's zero. So I'd like pick up full copy strategy instead of fine grain handle. Since clone_range overwrite target object case is rare, I don't think this will be a problem in current clone_range users.

@@ -61,7 +61,7 @@ GenericFileStoreBackend::GenericFileStoreBackend(FileStore *fs):
m_filestore_fiemap(g_conf->filestore_fiemap),
m_filestore_seek_data_hole(g_conf->filestore_seek_data_hole),
m_filestore_fsync_flushes_journal_data(g_conf->filestore_fsync_flushes_journal_data),
m_filestore_splice(false) {}
m_filestore_splice(g_conf->filestore_splice) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually change the behavior? it's going from false to (tunable) false.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the detection code in GenericFileStoreBackend.cc shoudl only run if it's true (instead of false) and disable if it's not detected (vs enable if it is).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I found the detection in _detect_feature is wrong.... I update _detect_feature too. Otherwise it will enable splice when m_filestore_splice is false....

@yuyuyu101 yuyuyu101 force-pushed the wip-fix-filestore-clone branch 3 times, most recently from fed6aa2 to 144e14b Compare September 19, 2016 11:33
goto out;
}

if ((uint64_t)st.st_size > dstoff) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this condition is correct.

Example:

  • from is 8KB long, and first 4KB is a hole
  • to is 1MB long and has no holes
  • srcoff = 0, len = 4096, dstoff = 1MB - 4KB
    Such operation should have punched a 4KB hole at 1MB - 4K, however nothing will happen since the (st.size > dstoff) condition does not hold.

The problem is that this method only copies the data, however it should have also punched the same holes as in the source.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed.....

@liewegas go ahead to complete the sparse copy feature, or totally fall down to full copy? I think both are ok. But I want to get an ack if we prefer to keep these freeze.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect in the hole case falling back to a full copy is fine. That path shouldn't be triggered with real workloads anyway.

Signed-off-by: Haomai Wang <haomai@xsky.com>
@yuyuyu101
Copy link
Member Author

@liewegas remove fiemap things, let's disable splice by default firstly.

@yuyuyu101
Copy link
Member Author

retest this please

@yuyuyu101
Copy link
Member Author

@liewegas ping?

@liewegas liewegas changed the title os/filestore: fix clone_range when source file exist hole in range os/filestore: disable use of splice by default Sep 28, 2016
@liewegas liewegas merged commit 51a1f86 into ceph:master Sep 28, 2016
@yuyuyu101 yuyuyu101 deleted the wip-fix-filestore-clone branch September 29, 2016 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants