Skip to contentSkip to conversation

Scrub and collection_list() order

DISCUSSION David Zafman 4 participants 7 messages Sep 8, 2016

lore
Share & tools
lore
#0 lore raw

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max of objects, but scrub for to do the snapshot consistency analysis it needs the head objects first. Can we add a collection_list() that returns the objects in completely reverse order? Or can it be changed to return head/snapdir objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code can go in reverse order for that segment.

David

#1 lore raw
Quoted 10 lines · David Zafman

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max of objects, but scrub for to do the snapshot consistency analysis it needs the head objects first. Can we add a collection_list() that returns the objects in completely reverse order? Or can it be changed to return head/snapdir objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code can go in reverse order for that segment.

collection_list has to return objects in ghobject_t sort order, so it's really bool operator<(const ghobject_t& l, const ghobject_t& r)'s fault that snaps come first. I don't think we can make it go backwards efficiently given how rocksdb etc works.

It might be possible to change the ghobject_t sort order, though, but I suspect it'll require a clusterwide osdmap flag again, similar to the sortbitwise thing we did earlier. Blech.

How bad is the current workaround?

sage

#2 lore raw

Hmm, that's annoying! I don't think we really want to change the sort ordering for this. David: how about we just keep a vector of un-processed clone metadata (whatever _scrub looks at) until we hit head? We can still deep scrub each clone in turn without the head, we just have to keep the metadata around until we finally come upon the head/snapdir.
-Sam

Quoted 28 lines · Sage Weil
Quoted 10 lines · David Zafman

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max of objects, but scrub for to do the snapshot consistency analysis it needs the head objects first. Can we add a collection_list() that returns the objects in completely reverse order? Or can it be changed to return head/snapdir objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code can go in reverse order for that segment.

collection_list has to return objects in ghobject_t sort order, so it's really bool operator<(const ghobject_t& l, const ghobject_t& r)'s fault that snaps come first. I don't think we can make it go backwards efficiently given how rocksdb etc works.

It might be possible to change the ghobject_t sort order, though, but I suspect it'll require a clusterwide osdmap flag again, similar to the sortbitwise thing we did earlier. Blech.

How bad is the current workaround?

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Sage Weil

Sage,

The current workaround is bad because if an object has many clones
we have to ignore the osd_scrub_chunk_max and find a chunk that includes the head object for those clones. Then the analysis code processes that chunk in reverse order. We think that this behavior is the long standing cause of performance issues during deep scrub in RBD environments with lots of clones. An object with N clones will chunk at least the N+1 objects no matter what the value of osd_scrub_chunk_max.

I have the analysis code modified to handle smaller arbitrary chunks
(state is saved between chunks) but that can only work if the objects arrive in reverse order since it still requires the head objects first.

David

Quoted 27 lines · Sage Weil
Quoted 10 lines · David Zafman

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max of objects, but scrub for to do the snapshot consistency analysis it needs the head objects first. Can we add a collection_list() that returns the objects in completely reverse order? Or can it be changed to return head/snapdir objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code can go in reverse order for that segment.

collection_list has to return objects in ghobject_t sort order, so it's really bool operator<(const ghobject_t& l, const ghobject_t& r)'s fault that snaps come first. I don't think we can make it go backwards efficiently given how rocksdb etc works.

It might be possible to change the ghobject_t sort order, though, but I suspect it'll require a clusterwide osdmap flag again, similar to the sortbitwise thing we did earlier. Blech.

How bad is the current workaround?

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Samuel Just

Sam,

You know what. Now that you mentioned that, I thought about the
consistency of this checking. If a new clone can appear between chunks where we've read the head object already and later come upon a new clone, this will produce a scrub error when there isn't one.

So we maybe need to find another way to improve performance because I claim that we need the head object and all clones as a single unit we retrieve from the replicas.

David

Quoted 36 lines · Samuel Just

Hmm, that's annoying! I don't think we really want to change the sort ordering for this. David: how about we just keep a vector of un-processed clone metadata (whatever _scrub looks at) until we hit head? We can still deep scrub each clone in turn without the head, we just have to keep the metadata around until we finally come upon the head/snapdir.
-Sam

Quoted 27 lines · Sage Weil
Quoted 10 lines · David Zafman

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max of objects, but scrub for to do the snapshot consistency analysis it needs the head objects first. Can we add a collection_list() that returns the objects in completely reverse order? Or can it be changed to return head/snapdir objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code can go in reverse order for that segment.

collection_list has to return objects in ghobject_t sort order, so it's really bool operator<(const ghobject_t& l, const ghobject_t& r)'s fault that snaps come first. I don't think we can make it go backwards efficiently given how rocksdb etc works.

It might be possible to change the ghobject_t sort order, though, but I suspect it'll require a clusterwide osdmap flag again, similar to the sortbitwise thing we did earlier. Blech.

How bad is the current workaround?

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Hmm, ok. We don't actually need to do the actual scan all at once while holding the pg lock. The scrubber already blocks new writes in the region. How about we drop the lock and requeue every scrub_chunk_max objects and continue on (on both the replica and the primary). The analysis would therefore be done all at once and the replicas would still reply with the same message, but the reads would at least not sit on a thread for a huge amount of time. -Sam

Quoted 63 lines · David Zafman

Sam,

You know what. Now that you mentioned that, I thought about the
consistency of this checking. If a new clone can appear between chunks where we've read the head object already and later come upon a new clone, this will produce a scrub error when there isn't one.

So we maybe need to find another way to improve performance because I claim that we need the head object and all clones as a single unit we retrieve from the replicas.

David

Quoted 45 lines · Samuel Just

Hmm, that's annoying! I don't think we really want to change the sort ordering for this. David: how about we just keep a vector of un-processed clone metadata (whatever _scrub looks at) until we hit head? We can still deep scrub each clone in turn without the head, we just have to keep the metadata around until we finally come upon the head/snapdir.
-Sam

Quoted 35 lines · Sage Weil
Quoted 16 lines · David Zafman

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max
of objects, but scrub for to do the snapshot consistency analysis it needs the
head objects first. Can we add a collection_list() that returns the objects
in completely reverse order? Or can it be changed to return head/snapdir
objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code
can go in reverse order for that segment.

collection_list has to return objects in ghobject_t sort order, so it's really bool operator<(const ghobject_t& l, const ghobject_t& r)'s fault that snaps come first. I don't think we can make it go backwards efficiently given how rocksdb etc works.

It might be possible to change the ghobject_t sort order, though, but I suspect it'll require a clusterwide osdmap flag again, similar to the sortbitwise thing we did earlier. Blech.

How bad is the current workaround?

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Samuel Just

Isn't there also a requirement (or else a bunch of embedded optimizations that assume) that clones sort before HEAD in terms of backfill et al?
-Greg

Quoted 41 lines · Samuel Just

Hmm, that's annoying! I don't think we really want to change the sort ordering for this. David: how about we just keep a vector of un-processed clone metadata (whatever _scrub looks at) until we hit head? We can still deep scrub each clone in turn without the head, we just have to keep the metadata around until we finally come upon the head/snapdir.
-Sam

Quoted 21 lines · Sage Weil
Quoted 10 lines · David Zafman

Sage,

Does any code depend on collection_list returning snapshots BEFORE head/snapdir? I'm trying to improve scrub's overhead per osd_scrub_chunk_max of objects, but scrub for to do the snapshot consistency analysis it needs the head objects first. Can we add a collection_list() that returns the objects in completely reverse order? Or can it be changed to return head/snapdir objects before the snapshots? The current code has to ignore osd_scrub_chunk_max in order to find a natural boundary so that the scrub code can go in reverse order for that segment.

collection_list has to return objects in ghobject_t sort order, so it's really bool operator<(const ghobject_t& l, const ghobject_t& r)'s fault that snaps come first. I don't think we can make it go backwards efficiently given how rocksdb etc works.

It might be possible to change the ghobject_t sort order, though, but I suspect it'll require a clusterwide osdmap flag again, similar to the sortbitwise thing we did earlier. Blech.

Quoted 7 lines

How bad is the current workaround?

sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html