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)
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>

No differences found