Skip to content

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

Merged
mattbenjamin merged 9 commits into
ceph:masterfrom
linuxbox2:wip-rgwlc-noreset
Mar 17, 2022
Merged

mattbenjamin merged 9 commits into
ceph:masterfrom
linuxbox2:wip-rgwlc-noreset

Conversation

@mattbenjamin

@mattbenjamin mattbenjamin commented Apr 8, 2021 •

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/49446

Signed-off-by: Matt Benjamin [email protected]

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

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 api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@dang

dang commented Apr 8, 2021

Copy link
Copy Markdown
Contributor

I do worry about the case where we fall behind for some reason, and then the next day finish the previous day's work, and then miss half of that day's work, because we were half way through the shard. So things that should have (and possibly could have) been processed that day will wait for the next day. It's not a huge issue, for sure, but maybe keep track whether we started the day at the beginning, and if we didn't, start over immediately? Although that will tend to propagate the issue forward into the next day, and make it more likely to continue. And, if we don't do it, then may be the next day won't have enough time to finish because of work from today, that could have been done if we started over.

@mattbenjamin
mattbenjamin force-pushed the wip-rgwlc-noreset branch 4 times, most recently from e02f033 to 4e15e76 Compare April 9, 2021 12:49
@mattbenjamin

Copy link
Copy Markdown
Contributor Author

fyi, the 3.3z7 version of this has passed downstream QE testing

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

(building for a teuthology run...)

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

ok, so I think this is a pass

@stale

stale Bot commented Jul 21, 2021

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@stale stale Bot added the stale label Jul 21, 2021
@github-actions

github-actions Bot commented Dec 3, 2021

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@dang

dang commented Mar 3, 2022

Copy link
Copy Markdown
Contributor

Yeah, looks correct

@cbodley

cbodley commented Mar 3, 2022

Copy link
Copy Markdown
Contributor

results: probably a pass?

1. one lifecycle timing failure, rest of same run passed, rest of the 43 runs passed

2. one lifecycle notification test failure--it looks like a script bug?  @yuvalif ?

3. other 3 failures look known

@mattbenjamin yeah, i agree that it's probably a pass. but since this PR does involve lifecycle, it's probably a good idea to do a --rerun to verify that the lifecycle timing issue goes away

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@cbodley yeah, it needs a new run anyway, with all the commits

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

Looks like again 1 lc run failed--many must have succeeded:
2022-03-07T14:16:28.810 INFO:teuthology.orchestra.run.smithi036.stderr:======================================================================
2022-03-07T14:16:28.810 INFO:teuthology.orchestra.run.smithi036.stderr:FAIL: s3tests_boto3.functional.test_s3.test_lifecycle_noncur_transition
2022-03-07T14:16:28.810 INFO:teuthology.orchestra.run.smithi036.stderr:----------------------------------------------------------------------
2022-03-07T14:16:28.810 INFO:teuthology.orchestra.run.smithi036.stderr:Traceback (most recent call last):
2022-03-07T14:16:28.811 INFO:teuthology.orchestra.run.smithi036.stderr: File "/home/ubuntu/cephtest/s3-tests/virtualenv/lib/python3.8/site-packages/nose/case.py", line 198, in runTest
2022-03-07T14:16:28.811 INFO:teuthology.orchestra.run.smithi036.stderr: self.test(*self.arg)
2022-03-07T14:16:28.811 INFO:teuthology.orchestra.run.smithi036.stderr: File "/home/ubuntu/cephtest/s3-tests/s3tests_boto3/functional/test_s3.py", line 10219, in test_lifecycle_noncur_transition
2022-03-07T14:16:28.811 INFO:teuthology.orchestra.run.smithi036.stderr: eq(len(expire1_keys[sc[2]]), 0)
2022-03-07T14:16:28.811 INFO:teuthology.orchestra.run.smithi036.stderr:AssertionError: 4 != 0
2022-03-07T14:16:28.812 INFO:teuthology.orchestra.run.smithi036.stderr:-------------------- >> begin captured stdout << ---------------------
2022-03-07T14:16:28.812 INFO:teuthology.orchestra.run.smithi036.stderr:storage classes configured: ['STANDARD', 'LUKEWARM', 'FROZEN']
2022-03-07T14:16:28.812 INFO:teuthology.orchestra.run.smithi036.stderr:

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@soumyakoduri thanks for reviewing!

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@dang another pass :)

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@mkogan1 do you notice anything suspicious? :)

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

@dang there is a bug or bug in advance_head, will update in a bit :(

@mattbenjamin

mattbenjamin commented Mar 17, 2022 •

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/mbenjamin-2022-03-17_07:54:27-rgw-wip-rgwlc-noreset-distro-basic-smithi/

(this passed)

@mattbenjamin

Copy link
Copy Markdown
Contributor Author

jenkins test make check

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]>
The intent is to permit tracing of the bucket processing scheduler, without
expiring or transitioning any objects.

Signed-off-by: Matt Benjamin <[email protected]>
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]>
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]>
@mattbenjamin
mattbenjamin merged commit 73ef518 into ceph:master Mar 17, 2022
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.

4 participants