Skip to content

Commit

Permalink
storage: queue requests to push txn / resolve intents on single keys
Browse files Browse the repository at this point in the history
Previously, high contention on a single key would cause every thread to
push the same conflicting transaction then resolve the same intent in
parallel. This is inefficient as only one pusher needs to succeed, and
only one resolver needs to resolve the intent, and then only one writer
should proceed while the other readers/writers should in turn wait on
the previous writer by pushing its transaction. This effectively
serializes the conflicting reader/writers.

One complication is that all pushers which may have a valid, writing
transaction (i.e., `Transaction.Key != nil`), must push either the
conflicting transaction or another transaction already pushing that
transaction. This allows dependency cycles to be discovered.
  • Loading branch information
spencerkimball committed May 30, 2018
1 parent 0969698 commit 6b1b429
Show file tree
Hide file tree
Showing 6 changed files with 592 additions and 31 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/batcheval/cmd_push_txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ func PushTxn(
if !pusherWins {
s = "failed to push"
}
log.Infof(ctx, "%s "+s+" %s: %s (pushee last active: %s)",
args.PusherTxn.Short(), args.PusheeTxn.Short(),
log.Infof(ctx, "%s "+s+" (push type=%s) %s: %s (pushee last active: %s)",
args.PusherTxn.Short(), args.PushType, args.PusheeTxn.Short(),
reason, reply.PusheeTxn.LastActive())
}

Expand Down
Loading

0 comments on commit 6b1b429

Please sign in to comment.