Enqueue purge snapshot directly 45/81945/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 7 May 2019 14:23:19 +0000 (16:23 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 7 May 2019 14:23:19 +0000 (16:23 +0200)
When we are sending abort+purge, make sure we propagate it out
as soon as possible.

Change-Id: I2b63aa20867a8b99b779115f0bb448c0e8ac9a22
JIRA: CONTROLLER-1879
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java

index 8975277..97b4a48 100644 (file)
@@ -83,6 +83,7 @@ import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContex
 import org.opendaylight.controller.cluster.datastore.persisted.AbortTransactionPayload;
 import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot;
 import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot.ShardSnapshot;
+import org.opendaylight.controller.cluster.datastore.persisted.PurgeTransactionPayload;
 import org.opendaylight.controller.cluster.messaging.MessageAssembler;
 import org.opendaylight.controller.cluster.messaging.MessageSlicer;
 import org.opendaylight.controller.cluster.messaging.SliceOptions;
@@ -363,9 +364,10 @@ public class Shard extends RaftActor {
                         (DataTreeCohortActorRegistry.CohortRegistryCommand) message);
             } else if (message instanceof PersistAbortTransactionPayload) {
                 final TransactionIdentifier txId = ((PersistAbortTransactionPayload) message).getTransactionId();
-                persistPayload(txId, AbortTransactionPayload.create(
-                        txId, datastoreContext.getInitialPayloadSerializedBufferCapacity()), true);
-                store.purgeTransaction(txId, null);
+                persistPayload(txId, AbortTransactionPayload.create(txId,
+                    datastoreContext.getInitialPayloadSerializedBufferCapacity()), true);
+                persistPayload(txId, PurgeTransactionPayload.create(txId,
+                    datastoreContext.getInitialPayloadSerializedBufferCapacity()), false);
             } else if (message instanceof MakeLeaderLocal) {
                 onMakeLeaderLocal();
             } else if (RESUME_NEXT_PENDING_TRANSACTION.equals(message)) {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.