You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smengcl (via GitHub)" <gi...@apache.org> on 2026/10/22 22:33:56 UTC

[PR] 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 [ozone]

smengcl opened a new pull request, #11705:
URL: https://github.com/apache/ozone/pull/11705

   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 whole `Scheduler.close()` call, which interrupts the tasks and waits up to 60 seconds for them. A `pruneSstFileValues` task that was waiting for that lock between two compaction log entries cannot react to the interrupt, so every close during a prune batch stalled `RDBStore.close()` for 60 seconds. After the wait the task took the lock and kept reading the compaction log table while `RDBStore` flushed and freed the DB, which can crash the OM with SIGSEGV in `RocksDB.get`.
   
   This PR:
   - Sets `closed` under the lock in `close()`, then shuts the scheduler down after releasing it, so a task waiting for the lock can get it and stop.
   - Makes every DB use by the scheduled tasks check `closed` first, under the same lock: `pruneSstFileValues` ends its batch, `getOlderFileNodes` returns nothing and `removeKeyFromCompactionLogTable` returns. No task touches the DB after `close()` returns, whatever the bounded scheduler wait returns. This is the same `closed` flag 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 after `close()` 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 while `close()` waits for it does not keep `close()` waiting. Without the fix `close()` is still waiting after 10 seconds.
   
   Ran locally: `TestRocksDBCheckpointDiffer` passed (58 tests, 0 failures, including both new tests). Checkstyle on `rocksdb-checkpoint-differ` reports 0 violations. CI will run on this PR.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] 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 [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang merged PR #11705:
URL: https://github.com/apache/ozone/pull/11705


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] 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 [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #11705:
URL: https://github.com/apache/ozone/pull/11705#issuecomment-6516747014

   Merged. Thanks @SaketaChalamchala @smengcl 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org