Commit 75777cca authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f0e33f8b
......@@ -69,9 +69,12 @@ package xbtree
//
// trackSet, ktrackNew, krebuildJobs + explain rebuild algo (query lock, check ktrackNew, krebuildJob, go/merge/...)
//
// XXX queries work on vδT snapshot. When updated, vδT is modified via RCU ...
//
// This locking organization allows non-overlapping queries/track-requests to
// run simultaneously. Without this property WCFS would not be able to serve
// several non-overlapping READ requests to one file in parallel.
// 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.
//
// --------
//
......@@ -188,6 +191,12 @@ type _ΔTtail struct {
krebuildJobs _RangedMap_RebuildJob // {} keycov -> job
}
// _RebuildJob represents currently in-progress vδT rebuilding job.
type _RebuildJob struct {
ready chan struct{} // closed when job completes
err error
}
// _ΔBroots represents roots-only part of ΔB.
//
// It describes which trees were changed, but does not provide δkv details for changed trees.
......@@ -209,14 +218,6 @@ type ΔTree struct {
}
// _RebuildJob represents currently in-progress vδT rebuilding job.
// XXX place
type _RebuildJob struct {
ready chan struct{} // closed when job completes
err error
}
// NewΔBtail creates new empty ΔBtail object.
//
// Initial tracked set is empty.
......@@ -470,14 +471,12 @@ func (δBtail *ΔBtail) vδTSnapForTrackedKey(root zodb.Oid, key Key) (vδT []Δ
// key ∈ ktrackNew -> this goroutine becomes responsible to start rebuilding vδT for it
// run rebuild job for all keys queued in ktrackNew so far
err = δTtail._runRebuildJob(root, δBtail)
if err != nil {
return nil, err
if err == nil {
vδT = δTtail.vδT
}
vδT = δTtail.vδT
δBtail.mu.Unlock()
return vδT, nil
return vδT, err
}
// vδTSnapForTracked returns vδT snapshot for root that takes into account all
......@@ -579,7 +578,7 @@ func (δTtail *_ΔTtail) _runRebuildJob(root zodb.Oid, δBtail *ΔBtail) (err er
// we are done
job.err = err
close(job.ready)
return job.err
return err
}
// rebuild1 rebuilds ΔBtail for single root.
......
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