Skip to content

quincy: rgwlc: remove explicit lc shard resets at start-of-run - #49527

Closed
mattbenjamin wants to merge 11 commits into
ceph:quincyfrom
linuxbox2:quincy-lc-2022
Closed

mattbenjamin wants to merge 11 commits into
ceph:quincyfrom
linuxbox2:quincy-lc-2022

Conversation

@mattbenjamin

@mattbenjamin mattbenjamin commented Dec 20, 2022 •

Copy link
Copy Markdown
Contributor

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

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

mattbenjamin and others added 11 commits December 20, 2022 12:03
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]>
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)
Comment thread src/rgw/rgw_lc.cc
if (r) {
return r;
}
std::this_thread::sleep_for(sleep_ms * 2 * retries++);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a linear backoff. Is that intentional? Exponential backoff is more commonly used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It probabably should be exponential, but this is what's on ceph/main now.

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

@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

2023-02-20T17:39:36.987 INFO:teuthology.orchestra.run.smithi029.stderr:======================================================================
2023-02-20T17:39:36.987 INFO:teuthology.orchestra.run.smithi029.stderr:FAIL: test that when object is deleted due to lifecycle policy, notification is sent on master
2023-02-20T17:39:36.987 INFO:teuthology.orchestra.run.smithi029.stderr:----------------------------------------------------------------------
2023-02-20T17:39:36.988 INFO:teuthology.orchestra.run.smithi029.stderr:Traceback (most recent call last):
2023-02-20T17:39:36.988 INFO:teuthology.orchestra.run.smithi029.stderr:  File "/usr/lib/python3.6/site-packages/nose/case.py", line 197, in runTest
2023-02-20T17:39:36.988 INFO:teuthology.orchestra.run.smithi029.stderr:    self.test(*self.arg)
2023-02-20T17:39:36.989 INFO:teuthology.orchestra.run.smithi029.stderr:  File "/home/ubuntu/cephtest/ceph/src/test/rgw/bucket_notification/test_bn.py", line 1753, in test_ps_s3_lifecycle_on_master
2023-02-20T17:39:36.989 INFO:teuthology.orchestra.run.smithi029.stderr:    assert False, err
2023-02-20T17:39:36.989 INFO:teuthology.orchestra.run.smithi029.stderr:AssertionError: no lifecycle event found for key: <Key: jdyvgo-8,ooo0>
2023-02-20T17:39:36.990 INFO:teuthology.orchestra.run.smithi029.stderr:-------------------- >> begin captured logging << --------------------

Suite run started:
https://pulpito.ceph.com/mbenjamin-2022-12-22_15:28:31-rgw-quincy-lc-2022-distro-default-smithi/

i see that same failure in these results

@cbodley cbodley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FAIL: test that when object is deleted due to lifecycle policy, notification is sent on master

@adamemerson

Copy link
Copy Markdown
Contributor

Since we'll be EoLing quincy, I'm going to close this, feel free to reopen against a newer branch.

@adamemerson adamemerson closed this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants