IdManager createIdPool should never return false positive Failure, causing wrong "Failed to create idPool for InterfaceMgr" error log but not diagstatus failure
Description
Environment
Activity
Faseela K July 17, 2018 at 7:24 AM
2018-07-16T14:13:17,725 | WARN | opendaylight-cluster-data-shard-dispatcher-68 | ShardDataTree | 229 - org.opendaylight.controller.sal-distributed-datastore - 1.8.0.SNAPSHOT | member-1-shard-default-operational: Store Tx member-1-datastore-operational-fe-0-txn-17-0: Conflicting modification for path /(urn:opendaylight:genius:lockmanager?revision=2016-04-13)locks/lock/lock[{(urn:opendaylight:genius:lockmanager?revision=2016-04-13)lock-name=groups}]. 2018-07-16T14:13:17,773 | INFO | opendaylight-cluster-data-akka.actor.default-dispatcher-54 | IdManager | 244 - org.opendaylight.genius.idmanager-impl - 0.5.0.SNAPSHOT | createIdPool called with input CreateIdPoolInput{getHigh=254, getLow=0, getPoolName=meters, augmentations={}} 2018-07-16T14:13:17,727 | ERROR | opendaylight-cluster-data-akka.actor.default-dispatcher-38 | LocalThreePhaseCommitCohort | 229 - org.opendaylight.controller.sal-distributed-datastore - 1.8.0.SNAPSHOT | Failed to prepare transaction member-1-datastore-operational-fe-0-txn-17-0 on backend org.opendaylight.mdsal.common.api.OptimisticLockFailedException: Optimistic lock failed for path /(urn:opendaylight:genius:lockmanager?revision=2016-04-13)locks/lock/lock[{(urn:opendaylight:genius:lockmanager?revision=2016-04-13)lock-name=groups}] at org.opendaylight.controller.cluster.datastore.ShardDataTree.lambda$processNextPendingTransaction$0(ShardDataTree.java:734) ~[229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.ShardDataTree.processNextPending(ShardDataTree.java:772) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.ShardDataTree.processNextPendingTransaction(ShardDataTree.java:719) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.ShardDataTree.startCanCommit(ShardDataTree.java:873) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.SimpleShardDataTreeCohort.canCommit(SimpleShardDataTreeCohort.java:99) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.CohortEntry.canCommit(CohortEntry.java:99) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator.handleCanCommit(ShardCommitCoordinator.java:239) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator.handleReadyLocalTransaction(ShardCommitCoordinator.java:201) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.Shard.handleReadyLocalTransaction(Shard.java:731) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.datastore.Shard.handleNonRaftCommand(Shard.java:330) [229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.raft.RaftActor.handleCommand(RaftActor.java:270) [214:org.opendaylight.controller.sal-akka-raft:1.8.0.SNAPSHOT] at org.opendaylight.controller.cluster.common.actor.AbstractUntypedPersistentActor.onReceiveCommand(AbstractUntypedPersistentActor.java:44) [221:org.opendaylight.controller.sal-clustering-commons:1.8.0.SNAPSHOT] at akka.persistence.UntypedPersistentActor.onReceive(PersistentActor.scala:275) [38:com.typesafe.akka.persistence:2.5.11] at org.opendaylight.controller.cluster.common.actor.MeteringBehavior.apply(MeteringBehavior.java:104) [221:org.opendaylight.controller.sal-clustering-commons:1.8.0.SNAPSHOT] at akka.actor.ActorCell$$anonfun$become$1.applyOrElse(ActorCell.scala:608) [35:com.typesafe.akka.actor:2.5.11] at akka.actor.Actor.aroundReceive(Actor.scala:517) [35:com.typesafe.akka.actor:2.5.11] at akka.actor.Actor.aroundReceive$(Actor.scala:515) [35:com.typesafe.akka.actor:2.5.11] at akka.persistence.UntypedPersistentActor.akka$persistence$Eventsourced$$super$aroundReceive(PersistentActor.scala:273) [38:com.typesafe.akka.persistence:2.5.11] at akka.persistence.Eventsourced$$anon$1.stateReceive(Eventsourced.scala:691) [38:com.typesafe.akka.persistence:2.5.11] at akka.persistence.Eventsourced.aroundReceive(Eventsourced.scala:192) [38:com.typesafe.akka.persistence:2.5.11] at akka.persistence.Eventsourced.aroundReceive$(Eventsourced.scala:191) [38:com.typesafe.akka.persistence:2.5.11] at akka.persistence.UntypedPersistentActor.aroundReceive(PersistentActor.scala:273) [38:com.typesafe.akka.persistence:2.5.11] at akka.actor.ActorCell.receiveMessage(ActorCell.scala:590) [35:com.typesafe.akka.actor:2.5.11] at akka.actor.ActorCell.invoke(ActorCell.scala:559) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.Mailbox.run(Mailbox.scala:224) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.Mailbox.exec(Mailbox.scala:234) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [35:com.typesafe.akka.actor:2.5.11] at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [35:com.typesafe.akka.actor:2.5.11] Caused by: org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException: Node was created by other transaction. at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkConflicting(SchemaAwareApplyOperation.java:80) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkWriteApplicable(SchemaAwareApplyOperation.java:182) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:134) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkChildPreconditions(AbstractNodeContainerModificationStrategy.java:302) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkMergeApplicable(AbstractNodeContainerModificationStrategy.java:313) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:137) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkChildPreconditions(AbstractNodeContainerModificationStrategy.java:302) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkMergeApplicable(AbstractNodeContainerModificationStrategy.java:313) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:137) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.StructuralContainerModificationStrategy.checkApplicable(StructuralContainerModificationStrategy.java:100) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkChildPreconditions(AbstractNodeContainerModificationStrategy.java:302) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.checkTouchApplicable(AbstractNodeContainerModificationStrategy.java:284) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:131) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.RootModificationApplyOperation.checkApplicable(RootModificationApplyOperation.java:71) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractDataTreeTip.validate(AbstractDataTreeTip.java:38) ~[423:org.opendaylight.yangtools.yang-data-impl:2.0.7] at org.opendaylight.controller.cluster.datastore.ShardDataTree.lambda$processNextPendingTransaction$0(ShardDataTree.java:726) ~[229:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT] ... 30 more
https://git.opendaylight.org/gerrit/#/c/72782/10/interfacemanager/interfacemanager-impl/src/main/java/org/opendaylight/genius/interfacemanager/InterfacemgrProvider.java@186 claims that IdManager createIdPool() "can fail on two nodes but isn't a failure as long as at least one node succeeds", and uses that as the justification why it's OK to
LOG.error
that as "Failed to create idPool for InterfaceMgr", but notifmStatusProvider.reportStatus(e);
it for GENIUS-108.If that is true, then IdManager createIdPool() really has a bug. It should never return a failure when actually the idPool was created successfully (on another node).
When that is fixed, or if it is determined that it's actually fine, then InterfacemgrProvider should be made to
ifmStatusProvider.reportStatus(e);
in case it "Failed to create idPool for InterfaceMgr".