pageserver: tighten up code around SLRU dir key handling #10082
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Changes in #9786 were functionally complete but missed some edges that made testing less robust than it should have been:
is_key_disposable
didn't consider SLRU dir keys disposableinit_empty
was always creating SLRU dir keys on all shardsThe result was that when we had a bug (#10080), it wasn't apparent in tests, because one would only encounter the issue if running on a long-lived timeline with enough compaction to drop the initially created empty SLRU dir keys, and some CLog truncation going on.
Closes: https://github.com/neondatabase/cloud/issues/21516
Summary of changes
test_clog_truncate
explicitly use a sharded tenantThe net result is that if one reverts #10080, then tests fail (i.e. this PR is a reproducer for the issue)