Bug 5153: Add timestamp to TransactionIdentifier 19/34019/4
authorTom Pantelis <tpanteli@brocade.com>
Wed, 3 Feb 2016 06:43:38 +0000 (01:43 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 11 Feb 2016 00:11:36 +0000 (19:11 -0500)
commit74fc38503a3565bed6218f65ab8f4425c61460a3
tree2d65e663474f8c63c6594a87ccac8b7d6cb01942
parent600e07c2adb213b614cad127070f1e7ff074b42b
Bug 5153: Add timestamp to TransactionIdentifier

TransactionIdentifiers are created locally but sent to the remote leader
so it's possible, after a restart, for the remote leader to see the same id
for 2 different txns since the local counter starts at 1. To alleviate
this I added a timestamp to TransactionIdentifier. I could've just used
a UUID but the counter is useful for debugging and a full UUID would
make the string version pretty long for logging. I think an additional
millisec timestamp is sufficient.

Change-Id: Iaabd3d25eb64dd14053f96336c48de90d4364678
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifier.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/identifiers/TransactionIdentifier.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/ChainedTransactionIdentifierTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/identifiers/TransactionChainIdentifierTest.java