X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShard.java;h=7ca9ca99284348be0f99b775076c6313788ebcf4;hb=refs%2Fchanges%2F29%2F22429%2F5;hp=c8f2b1b8d98a45e86a827bb7613fb94f850b4243;hpb=13ba9adfa24716a7b27bc4cfef198b3fa5c577b0;p=controller.git 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 c8f2b1b8d9..7ca9ca9928 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 @@ -156,6 +156,8 @@ public class Shard extends RaftActor { Dispatchers.DispatcherType.Transaction), self(), getContext(), shardMBean); snapshotCohort = new ShardSnapshotCohort(transactionActorFactory, store, LOG, this.name); + + } private void setTransactionCommitTimeout() { @@ -453,14 +455,15 @@ public class Shard extends RaftActor { try { commitCoordinator.handleReadyLocalTransaction(message, getSender(), this); } catch (Exception e) { - LOG.error("{}: Error handling LocalModifications for Tx {}", persistenceId(), + LOG.error("{}: Error handling ReadyLocalTransaction for Tx {}", persistenceId(), message.getTransactionID(), e); getSender().tell(new akka.actor.Status.Failure(e), getSelf()); } } else { ActorSelection leader = getLeader(); if (leader != null) { - LOG.debug("{}: Forwarding LocalModifications to leader {}", persistenceId(), leader); + LOG.debug("{}: Forwarding ReadyLocalTransaction to leader {}", persistenceId(), leader); + message.setRemoteVersion(getCurrentBehavior().getLeaderPayloadVersion()); leader.forward(message, getContext()); } else { noLeaderError(message); @@ -589,19 +592,19 @@ public class Shard extends RaftActor { } @Override - protected RaftActorSnapshotCohort getRaftActorSnapshotCohort() { + @VisibleForTesting + public RaftActorSnapshotCohort getRaftActorSnapshotCohort() { return snapshotCohort; } @Override @Nonnull protected RaftActorRecoveryCohort getRaftActorRecoveryCohort() { - return new ShardRecoveryCoordinator(store, persistenceId(), LOG); + return new ShardRecoveryCoordinator(store, store.getSchemaContext(), persistenceId(), LOG); } @Override protected void onRecoveryComplete() { - store.recoveryDone(); //notify shard manager getContext().parent().tell(new ActorInitialized(), getSelf());