Bug 7814: Fix InvalidActorNameException 90/53190/1
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:26:48 +0000 (00:26 -0500)
commitfaf24d4688f47ebeacd3d8e32be4979d416d1ad4
tree06c95dcd384d97cdc231a1a745a8db248e9daf58
parentcbdd5d2a5c233a00fe057bd0359cdeefdb7de4da
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/ShardTransactionFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java