From: Robert Varga Date: Tue, 7 May 2019 14:23:19 +0000 (+0200) Subject: Enqueue purge payload directly X-Git-Tag: release/fluorine-sr3~13 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=67aa99425b03ef148fee66d8f0bb363c8f73096a Enqueue purge payload directly 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 (cherry picked from commit 04547138454b730148250f38979436cb839b9892) --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java index 43f8595dd1..b8d6cfd00c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java @@ -84,6 +84,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; @@ -365,9 +366,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)) {