Fix shard deadlock in 3 nodes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / EntityOwnershipShardCommitCoordinator.java
index 6058e7e997c60a652086cf2ad6a63e1aa39c4fc6..4e344cd68825f006b2bd944eb9661fd7affd3f67 100644 (file)
@@ -237,7 +237,9 @@ class EntityOwnershipShardCommitCoordinator {
         BatchedModifications prunedModifications = new BatchedModifications(toPrune.getTransactionId(),
                 toPrune.getVersion());
         prunedModifications.setDoCommitOnReady(toPrune.isDoCommitOnReady());
-        prunedModifications.setReady(toPrune.isReady());
+        if (toPrune.isReady()) {
+            prunedModifications.setReady(toPrune.getParticipatingShardNames());
+        }
         prunedModifications.setTotalMessagesSent(toPrune.getTotalMessagesSent());
         for (Modification mod: toPrune.getModifications()) {
             if (canForwardModificationToNewLeader(mod)) {
@@ -275,7 +277,7 @@ class EntityOwnershipShardCommitCoordinator {
         BatchedModifications modifications = new BatchedModifications(
             new TransactionIdentifier(historyId, ++transactionIDCounter), DataStoreVersions.CURRENT_VERSION);
         modifications.setDoCommitOnReady(true);
-        modifications.setReady(true);
+        modifications.setReady();
         modifications.setTotalMessagesSent(1);
         return modifications;
     }