diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-05-12 11:02:48 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-05-12 13:18:11 +0000 |
commit | 742d5d49f147ff652d78f5b8d270c81008d96283 (patch) | |
tree | 68eac9c736e1b20350de6b76a5a1392a84da56d9 /clustercontroller-apps | |
parent | 32e26201ca86681150eb47661ae551a1c188c594 (diff) |
Don't attempt to actually execute document moves from a cancelled bucket mover
This prevents the following race condition where the bucket mover logic
fails to notify the content layer that the bucket sub DB status has changed
for a particular bucket:
1. Bucket state is changed over SPI, a mover is created and registered and
a BucketTask is scheduled onto the persistence queues to actually do the
document reads and finalize the move.
2. Before the bucket task is executed, bucket state is changed again over
the SPI. A new mover is created, the old one is cancelled (tagging
mover as not consistent) and another BucketTask is scheduled onto
the persistence queues. Note: the old task still remains.
3. Old bucket task is executed and performs the actual document moving
despite being cancelled. No notification is done towards the content
layer since the mover was tagged as not being consistent.
4. New bucket task is executed and tries to move the same document set
as the old mover. Since the documents are no longer present in the
source document DB, the moves fail. This tags the mover as inconsistent
and no notification is done. Bucket is automatically rechecked, but
since all docs are already moved away there is nothing more to do
and no subsequent mover is created. This means the "should notify?"
edge is not triggered and the content layer remains blissfully unaware
of any sub DB changes.
This commit simply changes cancellation to actually inhibit document moves
from taking place. This lets the preempting mover successfully complete its
moves, thus triggering the notify-edge as expected.
Diffstat (limited to 'clustercontroller-apps')
0 files changed, 0 insertions, 0 deletions