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/bluestore: fix writes that span existing shard boundaries #11451

Merged
merged 2 commits into from Oct 13, 2016

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Oct 12, 2016

For now I take the simple strategy and force a reshard if we happen to write across a boundary. I susepct the optimal solution is a bit more nuanced. For example, big writes could be split, but small writes probably shouldn't be. Or, better yet, this sort of write could just move the shard boundary over, or otherwise trigger a partial reshard. I'm happy leaving that for future work, though!

Signed-off-by: Sage Weil <sage@redhat.com>
@@ -1675,6 +1676,7 @@ void BlueStore::ExtentMap::reshard(Onode *o, uint64_t min_alloc_size)
}
}
}
needs_reshard = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Put that at function entrance to cover returns from the mid of the func?

if (shards.empty()) {
return false;
}
size_t s = seek_shard(offset);
Copy link
Contributor

Choose a reason for hiding this comment

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

seek_shard returns int

Copy link
Contributor

Choose a reason for hiding this comment

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

handling for not found shard? Or assert(s>=0) if this is unexpected.

@@ -2088,6 +2090,9 @@ BlueStore::Extent *BlueStore::ExtentMap::set_lextent(
b->ref_map.get(offset, length);
Extent *le = new Extent(logical_offset, offset, length, blob_depth, b);
extent_map.insert(*le);
if (spans_shard(offset, length)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

replace with if( !needs_reshard && spans_shard....)?

@ifed01
Copy link
Contributor

ifed01 commented Oct 13, 2016

LGTM except mentioned nits

A new write may create a new lextent that spans an
existing shard boundary.  If that happens, set a flag
so that we force a reshard when the onode is written.

Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit 37c27f0 into ceph:master Oct 13, 2016
@liewegas liewegas deleted the wip-bluestore-reshard-fixes branch October 13, 2016 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants