Commit f8bd9308 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b1aa6178
...@@ -290,17 +290,17 @@ type hwaiter struct { ...@@ -290,17 +290,17 @@ type hwaiter struct {
func (db *DB) headWait(ctx context.Context, at Tid) (err error) { func (db *DB) headWait(ctx context.Context, at Tid) (err error) {
defer xerr.Contextf(&err, "wait head ≥ %s", at) defer xerr.Contextf(&err, "wait head ≥ %s", at)
db.mu.Lock() // check if db is already down -> error even if at is under coverage
// XXX check if db is already down -> error even if at is under coverage?
// XXX under mu - ok?
if ready(db.down) { if ready(db.down) {
return db.downErr return db.downErr
} }
db.mu.Lock()
// we already have the coverage
if at <= db.δtail.Head() { if at <= db.δtail.Head() {
db.mu.Unlock() db.mu.Unlock()
return nil // we already have the coverage return nil
} }
// we have some δtail coverage, but at is ahead of that. // we have some δtail coverage, but at is ahead of that.
......
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