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
The alowedDuplicatePrepareSeqnos set is used to determine whether an
existing prepare found in the hashtable may be replaced by a new
prepare. This is a special case, only permitted after a
disconnect/reconnect when the commit for the existing prepare may have
been deduplicated. Otherwise, a second prepare for the same key without
an intervening commit/abort is rejected as "sync write in progress".
This set was previously initialised with all seqnos between the
highCompletedSeqno and the highSeqno of the VB. Prepares before the HCS
have been completed and should not be in the hashtable. Prepares after
the highSeqno have not yet been received, and do not need to be
considered.
The number of seqnos in the set when generated in this manner can be
very large; if no SyncWrites are seen, the lower bound of the window
(the highCompletedSeqno) would be zero. This leads to a very large set
being allocated, costing time and memory.
Solution: Instead, store the current highest trackedWrite seqno.
Any pending SyncWrite in the hashtable with a seqno lower than
this value *may* be replaced by another prepare, because the expected
Commit/Abort may have been deduplicated.
If such a prepare in the hashtable is then completed (indicating the
commit/abort was *not* deduped), any further prepare for the same key
after the completion is treated like any other new SyncWrite - it does
not need special treatment.
Change-Id: Ib07bc45e8e54a1256c988edea8a4bb17d6187507
Reviewed-on: http://review.couchbase.org/112596
Reviewed-by: Dave Rigby <[email protected]>
Tested-by: Dave Rigby <[email protected]>
0 commit comments