Bug 7814: Fix InvalidActorNameException 00/53100/5
authorTom Pantelis <tpanteli@brocade.com>
Fri, 10 Mar 2017 23:03:11 +0000 (18:03 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Sun, 12 Mar 2017 05:20:22 +0000 (05:20 +0000)
commit43fb391bf873b252383a8d736b2651b04da8d40d
tree9fdb41d39008c1dcfaee47e73d457512565708cf
parent9caba9a627d399cd308792679ecfd69eba8eacf5
Bug 7814: Fix InvalidActorNameException

When a read tx actor is created in the Shard, the actor name is generated
as eg "shard-member-1:datastore-operational@0:19" where 0 is the instance's
static generation id and 19 is the tx id. If the tx was created from a chain,
the chain's history id is appended. So every part of the name is constant for
the controller instance except the tx id, which is generated via a counter in
AbstractTransactionContextFactory, and the history id which is also generated
via a counter. The counters do make the full tx id unique in the cluster.
However if multiple shards are involved in a single front-end transaction,
they all have the same tx id and thus the actor names generated by each shard
would be the same. It seems that's what occurred in Bug 7814. Therefore I
changed the actor name to include the shard name.

Change-Id: Iacb11bb401bd6bded38847690f8009c115ee0637
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransactionActorFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java