Move commit payload propagation 72/76572/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 2 Oct 2018 15:20:16 +0000 (17:20 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Tue, 2 Oct 2018 17:02:58 +0000 (17:02 +0000)
commit212556d3799b2a15a2b1bb3882d435fa15af02ed
tree02b0c89769d91a2362e95309b915bbb9ca17a088
parent6a5ed98656a4d2cdb590f511d4e8ade965d13859
Move commit payload propagation

Since Shard.persistPayload() will shortcut when we do not have
a followers or persistence, we must update metadata before we
notify the cohort of the success, as for commit-immediate
transactions that will result in a purge payload being persisted.
That payload will shortcut, too, and execute on stack, hence
metadata will see purge before commit -- leaving it in inconsistent
leaky state.

Move allMetadataCommittedTransaction() calls from
applyReplicatedPayload() down to just after we modify the data
tree and before we invoke listeners.

Change-Id: I1ed2f62756367982cfff08302c79f1c63a871df2
JIRA: CONTROLLER-1746
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a97740e7fe14f99dc6f6f2b07e44f4123103ce0)
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java