BUG-8159: apply object lifecycle to metadata 38/57138/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 May 2017 11:20:41 +0000 (13:20 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 16 May 2017 17:11:55 +0000 (17:11 +0000)
commit1663020baaf094c4f2f31a18c787ce4d4efd11c8
tree0e6a38bb608f8ae9d36e4fd8c8f501193df698e9
parent6a1ea3449032a3500d1adc90a4dca565d86ca792
BUG-8159: apply object lifecycle to metadata

In leader role ShardDataTree needs to maintain its own view of
the metadata that is present in the journal, otherwise snapshots
do not contain accurate view nor can the shard transition to follower
while retaining correct state.

The initial idea was that this would be maintained in the replication
callbacks, but that is not really feasible, as it would spread the
code to different codepaths with the possibility of missed updates.

This patch centralizes metadata updates in payloadReplicationComplete(),
performing them unconditionally. Callbacks registered with
replicatePayload() are then used only for hooking in further events,
like sending messages to the frontend.

Change-Id: I2b3de068589f03fe988f11138436a4ec225e357e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java