rgw: Avoid spamming OSD requests on startup#38230
rgw: Avoid spamming OSD requests on startup#38230adamemerson wants to merge 11 commits intoceph:masterfrom
Conversation
3dbf608 to
323fae2
Compare
6377844 to
3720f97
Compare
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Provide quick and lengthy checks for the backing store of sharded logs, including a marker on shard 0 to speed things up. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Also don't use svc_cls. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
LazyFIFO opens the FIFO on first access. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Because everybody's sick of not having a container for non-default-constructible, immovable objects. Or at least I am. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
That way we don't start sending ops to open a FIFO until we need it. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
To manually complete an asynchronous librados call. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
3720f97 to
fbb2819
Compare
mattbenjamin
left a comment
There was a problem hiding this comment.
don't know if I can legitimately approve, but it looks sane
| int r_out = 0; | ||
| op.omap_get_vals_by_keys({ logmark_omap_key }, &values, &r_out); | ||
|
|
||
| auto oid = get_oid(0); |
There was a problem hiding this comment.
We keep the 'check' value on the zeroth shard, so after checking all the shards once, we only have to look at one shard after that.
| { | ||
| auto cct = static_cast<CephContext*>(ioctx.cct()); | ||
| bool omap = false; | ||
| { |
There was a problem hiding this comment.
are you doing this just to clear this off the stack after the check?
|
|
||
| cls_log_entry e; | ||
| cls.timelog.prepare_entry(e, ut, {}, key, entry); | ||
| cls_log_add_prepare_entry(e, utime_t(ut), {}, key, entry); |
There was a problem hiding this comment.
isn't ut already a utime_t (hence the name)?
There was a problem hiding this comment.
No, it's a real_time.
(I could change the name to make that clearer.)
|
|
||
| class RGWDataChangesOmap final : public RGWDataChangesBE { | ||
| using centries = std::list<cls_log_entry>; | ||
| RGWSI_Cls& cls; |
There was a problem hiding this comment.
just to clarify, is this just to delayer things?
There was a problem hiding this comment.
Not exactly. Since RGWDataChangesLog has to have an IoCtx to pass to log_acquire_backing and friends, it seemed silly for the backends to have to make their own instead of it just being passed into them. Especially since svc_cls just created and dropped an IoCtx with every call, just having one and using it seemed preferable.
| class RGWDataChangesFIFO final : public RGWDataChangesBE { | ||
| using centries = std::vector<ceph::buffer::list>; | ||
| std::vector<std::unique_ptr<rgw::cls::fifo::FIFO>> fifos; | ||
| dynarray<LazyFIFO> fifos; |
There was a problem hiding this comment.
Thank you. dynarray is something I've been wishing for for a long time to solve the 'dynamically sized array of things containing mutexes' problem.
mattbenjamin
left a comment
There was a problem hiding this comment.
looks good, good run
|
Looks good to me. |
|
|
||
| namespace ceph { | ||
| template<typename T, typename Allocator = std::allocator<T>> | ||
| class dynarray { |
There was a problem hiding this comment.
have you tried using ceph::containers::tiny_vector here? it was added for a similar purpose in #28987
| ext_mime_map = nullptr; | ||
| } | ||
|
|
||
| void rgw_complete_aio_completion(librados::AioCompletion* c, int r) { |
There was a problem hiding this comment.
it looks like this was mostly copied from CB_AioCompleteAndSafe in AioCompletionImpl.h. i worry that if librados changes, this copy could be missed and lead to bugs. could we use CB_AioCompleteAndSafe directly instead?
librados::CB_AioCompleteAndSafe cb(c->pc);
cb(r);|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Currently we send multiple OSD requests on startup to initialize the datalog. This is too many. To reduce this we mark a log (the set of shards) as usable with an omap entry on shard zero and take this as true unless something conflicts with it.
Secondly, initialize FIFOs lazily, so if we aren't doing anything relevant to the data log, don't pay to set them up.