HDDS-10696. Fix test failure caused by empty snapshot installation #6659
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?
After applying RATIS-2045, we saw lots of integration test failures as described in the HDDS-10696.
It is because of how MiniOzoneHACluster is set up. It doesn't set value for config
ozone.om.db.dirs
which OMDBCheckpointServlet is trying to access here.So when
ozone.om.db.dirs
is not set, ServerUtils#getDBPath returnsozone.metadata.dirs
. Because of that snapshotDir path: is getting evaluated to/Users/iamgroot/ozone-ws/ozone/hadoop-ozone/integration-test/target/test-dir/MiniOzoneClusterImpl-e919072d-914a-4de6-9bfc-5b610697b58a/ozone-meta/db.snapshots
, and the test is trying to access that doesn't exist causingNoSuchFileException
.In the actual snapshotDir path is
/Users/iamgroot/ozone-ws/ozone/hadoop-ozone/integration-test/target/test-dir/MiniOzoneClusterImpl-1146c9db-bf52-4c4b-94c9-131053141484/omNode-1/db.snapshots
which is inside the ozone data directory.To fix the issue, I changed the way we are trying to get the
snapshotDir
. So rather than creating one, it will get from RDBStore after the change dir should exist by default after snapshot feature.Also removed
Flaky
annotation from the test because jira: HDDS-7880 has been resolved after RATIS-1960.What is the link to the Apache JIRA
HDDS-10696
How was this patch tested?
Applied the patch on top of the changes where we saw the failure. And verify by running the full workflow and flaky-test-workflow 5x5 time.