From: Tomas Cere Date: Tue, 3 Nov 2020 11:38:04 +0000 (+0100) Subject: Make sure to clear candidate from memory X-Git-Tag: v3.0.2~10 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=5a824a836a00ff21a855d7339a2fa9b64678db52;hp=81b0b9d6fd26b1567bfc6dd80fa1a90bd30bff0b Make sure to clear candidate from memory The candidate needs to be cleared even when processing replicated candidate(ie on a follower) as there is no need to keep it deserialized in memory JIRA: CONTROLLER-1928 Change-Id: I1403dbe27def5e0040a8d9f145a92ac06aae9d1e Signed-off-by: Tomas Cere --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java index d4dabe5e85..c316fdfb9e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java @@ -389,7 +389,7 @@ public class ShardDataTree extends ShardDataTreeTransactionParent { private void applyReplicatedCandidate(final CommitTransactionPayload payload) throws DataValidationFailedException, IOException { - final Entry entry = payload.getCandidate(); + final Entry entry = payload.acquireCandidate(); final TransactionIdentifier identifier = entry.getKey(); LOG.debug("{}: Applying foreign transaction {}", logContext, identifier);