Repository navigation
quincy: rgwlc: remove explicit lc shard resets at start-of-run - #49527
mattbenjamin wants to merge 11 commits into
Conversation
Provide an option to disable automatic clearing of stale sessions-- which, unless disabled, happens after 2 lifecycle scheduling cycles. The default behavior is most likely not desired when a debugging or testing lifecycle processing with rgw_lc_debug_interval is set, and therefore re-entering a running session after 2 scheduling cycles is fairly likely. Signed-off-by: Matt Benjamin <[email protected]> (cherry picked from commit 8fc7d6d)
The intent is to permit tracing of the bucket processing scheduler, without expiring or transitioning any objects. Signed-off-by: Matt Benjamin <[email protected]> (cherry picked from commit 5f0a268)
This is a fencepost case when operating on the last element of a listing, apparently masked before Mark Kogan's segfault fix). Fixes: https://tracker.ceph.com/issues/55168 Signed-off-by: Matt Benjamin <[email protected]> (cherry picked from commit 9cfc378)
This is an alternative solution to the (newly exposed) lifecycle shard starvation problem reported by Jeegen Chen. There was always an starvation condition implied by the reset of lc shard head at the start of processing. The introduction of "stale sessions" in parallel lifecycle changes made it more visible, in particular when rgw_lc_debug_interval was set to a small value and many buckets had lifecycle policy. My hypothesis in this change is that lifecycle processing for each lc shard should /always/ continue through the full set of eligible buckets for the shard, regardless of how many processing cycles might be required to do so. In general, restarting at the first eligible bucket on each reschedule invites starvation when processing "gets behind", so just avoid it. Fixes: https://tracker.ceph.com/issues/49446 Signed-off-by: Matt Benjamin <[email protected]> (cherry picked from commit 6e2ae13adced6b3dbb2fe16b547a30e9d68dfa06) rgwlc: add a wraparound to continued shard processing If the full set of buckets for a given lc shard couldn't be processed in the prior cycle, processing will start with a non-empty marker. Note the initial marker position, then when the end of shard is reached, allow processing to wrap around to the logical beginning of the shard and proceeding through the initial marker. Signed-off-by: Matt Benjamin <[email protected]> Please enter the commit message for your changes. Lines starting (cherry picked from commit 0b8f683d3cf444cc68fd30c3f179b9aa0ea08e7c) don't report clearing incorrectly Signed-off-by: Matt Benjamin <[email protected]> Signed-off-by: Matt Benjamin <[email protected]> (cherry picked from commit b3fdd88) Signed-off-by: Matt Benjamin <[email protected]>
Remove now-unused RGWLC::bucket_lc_prepare. Wrap serializer calls in RGWLC::process(int index...) with simple backoff, limited to 5 retries. In RGWLC::process(int index...), also open-coded the behavior of RGWLC::bucket_lc_prepare(...), as the lock sharing between these methods is error prone. For now, that method exists, so that it can be called from the single-bucket process. Signed-off-by: Matt Benjamin <[email protected]>
Signed-off-by: Matt Benjamin <[email protected]>
Conveniently, this arose after removing all lifecycle shards from RADOS, proving it could be done safely. A restart is currently needed to recognize new lifecycle shards, if rgw_gc_max_objs also changed. Signed-off-by: Matt Benjamin <[email protected]>
E.g.,
[
{
"bucket": ":bucket1:f2f4a8dd-7ec9-4758-bc4f-c8f5fbc85109.4137.2",
"shard": "lc.6",
"started": "Fri, 18 Feb 2022 17:30:16 GMT",
"status": "COMPLETE"
},
...
]
The prototyped approach adds a copy of the shard name (which is
assured to be a small string) to rgw::sal::LCEntry. It's not
expected to be represented in underlying store types.
Signed-off-by: Matt Benjamin <[email protected]>
Restore (and robustify) the assertion that, in general, each bucket shard should be processed once per scheduling cycle. If the prior cycle did not finish, processing in the current cyhcle will continue from the marker where the last cycle left off. Signed-off-by: Matt Benjamin <[email protected]>
On review, this constraint was correct--it does reliably prevent same-cycle re-runs when a lc threads rendezvous on a bucket. Also, for concurrent (or stale) and already processed buckets, remember to advance head past the corresponding buckets. Signed-off-by: Matt Benjamin <[email protected]>
SimpleBackoff from c069eb7 has `sleep_ms` which is wrongly set to 0 after the first iteration. Fix it with first retry as no-op sleep call. Quincy backport of full lifecycle scheduling feature https://tracker.ceph.com/issues/58329 Signed-off-by: Tongliang Deng <[email protected]> (cherry picked from commit 377955f)
| if (r) { | ||
| return r; | ||
| } | ||
| std::this_thread::sleep_for(sleep_ms * 2 * retries++); |
There was a problem hiding this comment.
This is a linear backoff. Is that intentional? Exponential backoff is more commonly used.
There was a problem hiding this comment.
It probabably should be exponential, but this is what's on ceph/main now.
|
@mattbenjamin @yuvalif this seems to be causing a failure in the quincy notification tests: see teuthology.log from wip-yuri8-testing. other recent quincy batches without this PR are passing
i see that same failure in these results |
cbodley
left a comment
There was a problem hiding this comment.
FAIL: test that when object is deleted due to lifecycle policy, notification is sent on master
|
Since we'll be EoLing quincy, I'm going to close this, feel free to reopen against a newer branch. |
This is an alternative solution to the (newly exposed) lifecycle
shard starvation problem reported by Jeegen Chen.
There was always an implied starvation condition implied by the
reset of lc shard head at the start of processing. The introduction
of "stale sessions" in parallel lifecycle changes made it more
visible, in particular when rgw_lc_debug_interval was set to a small
value and many buckets had lifecycle policy.
My hypothesis in this change is that lifecycle processing for each
lc shard should /always/ continue through the full set of eligible
buckets for the shard, regardless of how many processing cycles might
be required to do so. There is no semantic basis for restarting at the
first eligible bucket in any circumstance, and doing so was itself
a latent bug.
Fixes: https://tracker.ceph.com/issues/58329
Signed-off-by: Matt Benjamin [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows