You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MB-33186 [SR]: Use bySeqno scan for warmup of Prepared SyncWrites
Modify the algorithm used by Warmup::loadPreparedSyncWrites() to load
any in-flight (not yet committed / or aborted) SyncWrites from disk.
+Background+
Initially the approach chosen was to identify these prepared
SyncWrites by performing a range scan on the byKey index, looking for
all mutations in the DurabilityPrepare namespace. This however relies
on deleting Prepared SyncWrites from disk whenever they are Committed
or Aborted.
This is undesirable as it requires an additional item to be flushed
every time we perform a commit (the delete of the prepared item). As
such we do not delete Prepared items when Committed (only when Aborted
as that's necessary to mark they should no longer be considered
outstanding).
However, this means that Warmup cannot rely on the (not-deleted)
Prepared Sync Writes found on disk still being in-flight - they could
have already been Committed.
+Solution+
Instead of performing a byKey scan, perform an in-order scan of the
seqno index:
a) For each Prepared item found, add to the Durability Monitor and
HashTable.
b) For each Committed (via Mutation or Prepare) item, if a prepared
item exists in the HashTable (i.e. was added at step (a)) then mark
it as Committed in the DurabilityMonitor.
At the end of the scan, all in-flight Prepared items (which did not
have a Commit persisted to disk) will be registered with the Durability
Monitor.
Note: The above is functionally correct, however it it potentially
inefficient - we must scan the complete bySeqno tree to identify
all in-flight SyncWrites. A later patch will introduce an
optimzation where we can use the high_committed_seqno to
contrain the range of seqnos scanned to the end of the tree.
Change-Id: I799eb3e6120716ddb979aba90e6cef3f82ada50e
Reviewed-on: http://review.couchbase.org/108010
Tested-by: Build Bot <[email protected]>
Reviewed-by: Paolo Cocchi <[email protected]>
0 commit comments