Repository navigation
HDDS-17358. Closing the OM DB during a compaction DAG prune batch stalls and can crash the OM when the pruner reads the freed DB - #11705
Merged
Conversation
…lls and can crash the OM when the pruner reads the freed DB Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SaketaChalamchala
approved these changes
Oct 29, 2026
SaketaChalamchala
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the patch @smengcl . lgtm. Raised this as a follow-up HDDS-17565
smengcl
marked this pull request as ready for review
October 30, 2026 01:48
Contributor
|
Merged. Thanks @SaketaChalamchala @smengcl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
RocksDBCheckpointDiffer.close()held the differ lock (synchronized (this)) for the wholeScheduler.close()call, which interrupts the tasks and waits up to 60 seconds for them. ApruneSstFileValuestask that was waiting for that lock between two compaction log entries cannot react to the interrupt, so every close during a prune batch stalledRDBStore.close()for 60 seconds. After the wait the task took the lock and kept reading the compaction log table whileRDBStoreflushed and freed the DB, which can crash the OM with SIGSEGV inRocksDB.get.This PR:
closedunder the lock inclose(), then shuts the scheduler down after releasing it, so a task waiting for the lock can get it and stop.closedfirst, under the same lock:pruneSstFileValuesends its batch,getOlderFileNodesreturns nothing andremoveKeyFromCompactionLogTablereturns. No task touches the DB afterclose()returns, whatever the bounded scheduler wait returns. This is the sameclosedflag the compaction listeners already check.Nothing changes when no prune task is running.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17358
How was this patch tested?
Two new tests in
TestRocksDBCheckpointDiffer:testPruneTasksDoNotUseDbAfterClose: running both prune tasks afterclose()leaves the compaction log entry in the table and in the prune queue. Without the fix the entry is deleted.testCloseDoesNotWaitForTaskBlockedOnDifferLock: a scheduled task that tries to take the differ lock whileclose()waits for it does not keepclose()waiting. Without the fixclose()is still waiting after 10 seconds.Ran locally:
TestRocksDBCheckpointDifferpassed (58 tests, 0 failures, including both new tests). Checkstyle onrocksdb-checkpoint-differreports 0 violations. CI will run on this PR.🤖 Generated with Claude Code