BUG-8159: apply object lifecycle to metadata 40/57140/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 May 2017 11:20:41 +0000 (13:20 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Tue, 16 May 2017 12:55:52 +0000 (12:55 +0000)
commit6303adf6be756fc7cb02823673fa3661950c3599
treee3e22ad7db5ae8535291ed2667c350923c5d9496
parent390c714cdeae2efe67d55d5a401929653b534f5c
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

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.