smengcl commented on code in PR #11054:
URL: https://github.com/apache/ozone/pull/11054#discussion_r4099836275
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -1442,25 +1583,28 @@ public void notifyStatusChanged() {
// Therefore we should clear the table so RM starts from a clean
// state.
containerReplicaPendingOps.clear();
+ // clear() discards pending ops without firing opCompleted, so also
+ // reset the reconstruction tracking that opCompleted maintains.
Review Comment:
A send can hold that lock while notifyStatusChanged() clears pending ops.
The send then schedules an ADD op, after which
globalReconstructionTracker.clear() erases its reservation. The ADD remains
pending but no longer counts toward the global limit. pls clear both structures
under the same lock and check both states in the concurrency test.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -1442,25 +1583,28 @@ public void notifyStatusChanged() {
// Therefore we should clear the table so RM starts from a clean
// state.
containerReplicaPendingOps.clear();
+ // clear() discards pending ops without firing opCompleted, so also
+ // reset the reconstruction tracking that opCompleted maintains.
Review Comment:
```diff
---
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java
+++
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java
@@
- containerReplicaPendingOps.clear();
- // clear() discards pending ops without firing opCompleted, so
also
- // reset the reconstruction tracking that opCompleted maintains.
globalReconstructionTracker.clear();
@@
void clear() {
lock.lock();
try {
+ containerReplicaPendingOps.clear();
pendingFragmentCountByCommandId.clear();
inflightCount.set(0);
---
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestReplicationManager.java
+++
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestReplicationManager.java
@@
assertTrue(notifyCompleted.get());
+
assertTrue(containerReplicaPendingOps.getPendingOps(container.containerID()).isEmpty());
+ assertEquals(0, rm.getInflightReconstructionCount());
```
--
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]