v2.0: Invoke ancient slots shrinking only if skipping rewrites is enabled (backport of #3266) #3580
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
Ancient slots shrinking currently should be done only when skipping rewrites is enabled. However, the entry function to ancient slots shrinking is unconditionally invoked in ABS.
Summary of Changes
Add a guarding check that prevents invocation of ancient slots shrinking unless the skip rewrites is enabled from the command line or by the feature gate.
The backport is necessary because the ancient slot shrinking was added before v2.0 but wasn't disabled by default. The implementation of ancient slot shrinking in v2.0 isn't stable and may cause resource exhaustion by not cleaning up ancient storages sufficiently. To prevent negative performance effects this change disables the ancient slot shrinking by default and guards its invocation by a command line option or the corresponding feature flag.