From: Robert Varga Date: Thu, 11 Nov 2021 08:22:08 +0000 (+0100) Subject: Disable state tracking on ReadyLocalTransaction X-Git-Tag: v4.0.7~20 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=35b5462f1ebde45b569664af28199acb437a28d9 Disable state tracking on ReadyLocalTransaction We are failing to recognize ReadyLocalTransaction as an ask-based message, leading to us populating state. JIRA: CONTROLLER-2021 Change-Id: I48b3c57e11430a5ca15e0559f2a8e13627f4bab1 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendMetadata.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendMetadata.java index d5ecbf6ea4..c8341e29bc 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendMetadata.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendMetadata.java @@ -133,7 +133,7 @@ final class FrontendMetadata extends ShardDataTreeMetadata self().tell(message, sender)) .expireStateAfterInactivity(datastoreContext.getRequestTimeout(), TimeUnit.NANOSECONDS).build(); @@ -818,22 +818,23 @@ public class Shard extends RaftActor { @SuppressWarnings("checkstyle:IllegalCatch") private void handleReadyLocalTransaction(final ReadyLocalTransaction message) { - LOG.debug("{}: handleReadyLocalTransaction for {}", persistenceId(), message.getTransactionId()); + final TransactionIdentifier txId = message.getTransactionId(); + LOG.debug("{}: handleReadyLocalTransaction for {}", persistenceId(), txId); boolean isLeaderActive = isLeaderActive(); if (isLeader() && isLeaderActive) { + askProtocolEncountered(txId); try { commitCoordinator.handleReadyLocalTransaction(message, getSender(), this); } catch (Exception e) { - LOG.error("{}: Error handling ReadyLocalTransaction for Tx {}", persistenceId(), - message.getTransactionId(), e); + LOG.error("{}: Error handling ReadyLocalTransaction for Tx {}", persistenceId(), txId, e); getSender().tell(new Failure(e), getSelf()); } } else { ActorSelection leader = getLeader(); if (!isLeaderActive || leader == null) { messageRetrySupport.addMessageToRetry(message, getSender(), - "Could not process ready local transaction " + message.getTransactionId()); + "Could not process ready local transaction " + txId); } else { LOG.debug("{}: Forwarding ReadyLocalTransaction to leader {}", persistenceId(), leader); message.setRemoteVersion(getCurrentBehavior().getLeaderPayloadVersion()); @@ -1119,7 +1120,7 @@ public class Shard extends RaftActor { @Override public final String persistenceId() { - return this.name; + return name; } @Override diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractDistributedDataStoreIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractDistributedDataStoreIntegrationTest.java index 11f0e3d02a..6563ff6eda 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractDistributedDataStoreIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractDistributedDataStoreIntegrationTest.java @@ -15,7 +15,6 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.junit.Assume.assumeFalse; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.timeout; @@ -305,8 +304,6 @@ public abstract class AbstractDistributedDataStoreIntegrationTest { } private static void assertAskMetadata(final FrontendClientMetadata clientMeta) { - // FIXME: needs to be enabled - assumeFalse(true); // ask based should track no metadata assertEquals(List.of(), clientMeta.getCurrentHistories()); }