Skip to content

Commit

Permalink
Merge pull request #5219 from bdarnell/intent-resolver
Browse files Browse the repository at this point in the history
storage: limit goroutine creation in intent resolution
  • Loading branch information
bdarnell committed Mar 14, 2016
2 parents 1eb1136 + bae254c commit 5d08c85
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 316 deletions.
7 changes: 4 additions & 3 deletions storage/gc_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ func (gcq *gcQueue) process(now roachpb.Timestamp, repl *Replica,
}
}

if pErr := repl.resolveIntents(repl.context(), intents, true /* wait */, false /* !poison */); pErr != nil {
if pErr := repl.store.intentResolver.resolveIntents(repl.context(), repl, intents,
true /* wait */, false /* !poison */); pErr != nil {
return pErr.GoError()
}

Expand Down Expand Up @@ -346,14 +347,14 @@ func processTransactionTable(r *Replica, txnMap map[uuid.UUID]*roachpb.Transacti
// Note: Most aborted transaction weren't aborted by their client,
// but instead by the coordinator - those will not have any intents
// persisted, though they still might exist in the system.
if err := r.resolveIntents(r.context(),
if err := r.store.intentResolver.resolveIntents(r.context(), r,
roachpb.AsIntents(txn.Intents, &txn), true /* wait */, false /* !poison */); err != nil {
log.Warningf("failed to resolve intents of aborted txn on gc: %s", err)
}
case roachpb.COMMITTED:
// It's committed, so it doesn't need a push but we can only
// GC it after its intents are resolved.
if err := r.resolveIntents(r.context(),
if err := r.store.intentResolver.resolveIntents(r.context(), r,
roachpb.AsIntents(txn.Intents, &txn), true /* wait */, false /* !poison */); err != nil {
log.Warningf("unable to resolve intents of committed txn on gc: %s", err)
// Returning the error here would abort the whole GC run, and
Expand Down
Loading

0 comments on commit 5d08c85

Please sign in to comment.