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
[BP] MB-46439: Don't remove resolved sync-writes when getting cookies
Currently ActiveDurabilityMonitor::getCookiesForInFlightSyncWrites()
isn't idempotent with respect to the sync-writes stored in
resolvedQueue. As it removes ActiveSyncWrite when trying to get hold of
their cookie so we can give an ambiguous status to the client.
This is problematic as before this patch the DurabilityCompletionTask
and DurabilityTimeoutTask could run after
getCookiesForInFlightSyncWrites() is called. This could mean that we end
up completing and persisting sync-writes to disk out of order. Due to
the sync-writes that where in resolvedQueue being removed before they
had be process by the DurabilityCompletionTask.
To fix this we've modified getCookiesForInFlightSyncWrites() to leave
the resolvedQueue in a valid state, with all the sync-writes that it had
before still there and in the same order, just with their cookie
removed. To do this we take hold of a write lock to the ADM state and
also the resolvedQueue consumer lock. This should give use exclusive
access so both the resolvedQueue and trackedWrites. Then we go though
the resolvedQueue removing ActiveSyncWrites and cache them in a vector.
To restore the state of the resolvedQueue we reset the queue after its
empty and re-push all the ActiveSyncWrites.
Change-Id: If4529c6e4074ef2e332e196a728919a26ba65c98
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/154128
Tested-by: Build Bot <[email protected]>
Well-Formed: Build Bot <[email protected]>
Reviewed-by: Richard de Mellow <[email protected]>
0 commit comments