smengcl opened a new pull request, #11602: URL: https://github.com/apache/ozone/pull/11602
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? When a QUASI_CLOSED Ratis container is force closed, its sequence ID is the highest one reported by any replica. ReplicationManager then counts every QUASI_CLOSED replica with a different sequence ID as unhealthy and deletes it once there are enough CLOSED replicas, so which replicas survive depends on a single replica's report. Origin IDs cannot help, because a copy made by replication reports the origin of the replica it was copied from. This PR keeps a QUASI_CLOSED replica of a CLOSED container while it is on its origin datanode (`ReplicationManagerUtil.isKeptOriginReplica`): - It is never a delete candidate (`selectUnhealthyReplicasForDelete`, used by the under and over replication handlers). - It is left out of the replica counts in `RatisReplicationCheckHandler.checkHealth`, `RatisOverReplicationHandler` and `MisReplicationHandler`, so it does not make the container look over or mis replicated, and the container stays HEALTHY (block deletion and moves keep working). - Its datanode is an excluded node, not a used node, in `getExcludedAndUsedNodes`. - `EmptyContainerHandler` accepts it when it is empty, so the container can still be deleted. Copies on other datanodes are handled as before. QUASI_CLOSED containers are not affected. Also, `AbstractContainerReportHandler` no longer raises the sequence ID of a CLOSED container from a report (it already logged an error for this case). Size: production 5 files, +33 -7. Tests 7 files, +162 -8. Behavior change: after a force close, replicas that lag behind stay on their origin datanodes instead of being deleted, so such a container can keep up to two extra replicas until it is deleted. Lagging replicas on a decommissioned datanode are not copied, as before. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17101 ## How was this patch tested? - New tests in `TestRatisOverReplicationHandler`, `TestRatisReplicationCheckHandler`, `TestRatisMisReplicationHandler`, `TestReplicationManagerUtil`, `TestEmptyContainerHandler` and `TestContainerReportHandler`. Existing tests that delete a lagging QUASI_CLOSED replica now use a copy on another datanode. - Each part of the change was disabled in turn, and a test fails for each. - `hdds-server-scm` replication, report, empty container and deleted block log tests pass locally. 🤖 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: [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]
