Gargi-jais11 opened a new pull request, #11676: URL: https://github.com/apache/ozone/pull/11676
## What changes were proposed in this pull request? DiskBalancer and `ozone admin container reconcile` can run on the same container replica on one datanode at the same time. Reconciliation keeps a reference to the container object it looked up at the start and repairs that object without holding the container lock. DiskBalancer holds only the read lock, copies the replica to another volume, swaps the live entry in **ContianerSet** and marks the old replica **DELETED**. Neither side knows about the other. *What goes wrong* * Repairs written after the copy was taken exist only on the old replica, which is then deleted — the admin sees a successful reconcile log, but the replica that remains was not repaired. * The closing incremental container report (ICR) can be built from the retired replica (wrong BCSID, checksum, or **DELETED** state) while the live replica on the new disk is different. * SCM can keep a stale view until the next full container report (default 60m), or briefly treat the container as under-replicated if the ICR says **DELETED**. As a result : No data loss relative to the state before reconcile, but the repair is lost and is not retried automatically. Operators may see false success in logs and wrong replica/mismatch signals in SCM/Recon until the next report or scan. **Proposed Fix** Mark the replica as "being reconciled" under `ContainerSet.getContainerWithWriteLock` at reconcile start; DiskBalancer skips containers with that mark under its read lock. Reconcile waits for an in-progress move (read lock) and then works on the live replica. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16807 ## How was this patch tested? Added unit tests. Generated with Specula (Claude Opus 5.5) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
