Commit 8b317452 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 22aa3387
......@@ -61,8 +61,35 @@ package zdata
//
// Concurrency
//
// XXX
// XXX note about SliceByFileRev Zinblk snapshotting
// In order to allow multiple Track and queries requests to be served in
// parallel, ΔFtail bases its concurrency promise on ΔBtail guarantees +
// snapshot-style access for vδE and ztrackInBlk in queries:
//
// 1. Track calls ΔBtail.Track and quickly updates .byFile, .byRoot and
// _RootTrack indices under a lock.
//
// 2. BlkRevAt queries ΔBtail.GetAt and then combines retrieved zblk object
// with vδE and δZ.
//
// 3. SliceByFileRev queries ΔBtail.SliceByRootRev and then merges retrieved
// vδT data with vδZ, vδE and ztrackInBlk.
//
// 4. In queries vδE is retrieved/build in snapshot style similarly to how vδT
// is built in ΔBtail. Note that vδE needs to be build only the first time,
// and does not need to be rebuilt further, so the logic in ΔFtail is simpler
// compared to ΔBtail.
//
// 5. for ztrackInBlk - that is used by SliceByFileRev query - an atomic
// snapshot is retrieved for objects of interest. This allows to hold
// δFtail.mu lock for relatively brief time without blocking other parallel
// Track/queries requests for long.
//
// Combined this organization allows non-overlapping queries/track-requests
// to run simultaneously. This property is essential to WCFS because otherwise
// WCFS would not be able to serve several non-overlapping READ requests to one
// file in parallel.
//
// See "Concurrency" in ΔBtail organization for more details.
import (
"context"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment