HDDS-11721. Fix container export failure when container scanner is running on a schema v2 container #8841
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.
What changes were proposed in this pull request?
Container export operations for Schema v2 containers can fail when a scan is simultaneously in progress. This occurs because the scanner maintains an active database (Db) handle, preventing the export process from clearing the Db handle cache.
Previously, the export process attempted to clear this cache (a feature introduced in HDDS-3363). However, with the Db handle still held by the scanner, this cache-clearing instruction would fail, leading to the overall export failure.
To address this, the export process has been updated to no longer attempt to clear the Db handle cache, allowing for successful container exports even when a scan is ongoing.
A unit test has been added which reproduces the failure conditions.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11721
How was this patch tested?
CI: https://github.com/ptlrs/ozone/actions/runs/16429140937
Flaky test 10x10 for:
TestKeyValueContainer
TestDecommissionAndMaintenance