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: optimize _collection_list. #18777

Merged
merged 3 commits into from Nov 20, 2017

Conversation

majianpeng
Copy link
Member

No description provided.

@@ -7213,8 +7213,7 @@ int BlueStore::_collection_list(
if (!pnext)
pnext = &static_next;

if (start == ghobject_t::get_max() ||
start.hobj.is_max()) {
if (start.is_max()) {
Copy link
Member

Choose a reason for hiding this comment

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

this is important because we want to skip out even if ghobject_t::max is false but hobj.max is true.

Copy link
Member

@liewegas liewegas left a comment

Choose a reason for hiding this comment

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

.

@liewegas liewegas changed the title optimize bluestore _collection_list. os/bluestore: optimize _collection_list. Nov 16, 2017
@majianpeng
Copy link
Member Author

update. BTW Whan't mean if ghobject_t::is_max is false but hobj.is_max is true? Thanks!

@liewegas
Copy link
Member

See 3fa09f0. If I remember correctly it was either this, or adding a special case in the caller so that if we have hobject_t max and are composing the ghobject_t we conditoinally do {shard,hobj} or max depending on whether hobj.is_max(). This was simpler (since <shard,max> is still clearly the end of the collection).

@liewegas
Copy link
Member

Thanks!

@majianpeng
Copy link
Member Author

Thanks very much sage!

…stent_count.

If next != ghobject_t::get_max(), this mean collection has more data
than nonexistent_count. For this we should bypass check.
And fix wrong comments because _collection_list don't return object num.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
If next is null, we already set a non-null to it. So don't check again.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
@tchaikov tchaikov merged commit cb3a5c2 into ceph:master Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants