Skip to content

Commit

Permalink
disable txn auto gc
Browse files Browse the repository at this point in the history
this could lead to spurious test failures:

* txn writes some intents, but not in a single
  round-trip
* concurrent reader runs into open intent, tries to push
* before it gets there, txn finishes with only local intents;
  txn record gets deleted
* push begins, does not find txn entry and fails
* potentially repeat forever or (if a push succeeds) until
  recreated txn entry times out.

I ran into this since it created an endless loop in
conjunction with buggy test code, but it's better to
disable this for now until we actually have the GC
story in place. My intuition is that we'll want to
limit this to single-roundtrip txns, whose intents
are never visible to anyone except the requests in
the batch (and even then we must be careful that
they are not collected as "skipped intents" in
some cases).
  • Loading branch information
tbg committed Sep 29, 2015
1 parent fa8e0ac commit ec16f29
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kv/dist_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func (ds *DistSender) sendChunk(ctx context.Context, ba proto.BatchRequest) (*pr

if err != nil {
if log.V(1) {
log.Warningf("failed to invoke %s: %s", ba, pErr)
log.Warningf("failed to invoke %s: %s", ba, err)
}
}
return reply, err
Expand Down
5 changes: 4 additions & 1 deletion storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ var TestingCommandFilter func(proto.Request) error
// upon EndTransaction if they only have local intents (which can be
// resolved synchronously with EndTransaction). Certain tests become
// simpler with this being turned off.
var txnAutoGC = true
// TODO(tschottdorf): Push after removal can happen if txn is not
// single-roundtrip, and pusher will recreate a PENDING entry, getting
// stuck. Since txn gc story is not done yet (#2062), disabled for now.
var txnAutoGC = false

// raftInitialLogIndex is the starting point for the raft log. We bootstrap
// the raft membership by synthesizing a snapshot as if there were some
Expand Down
2 changes: 1 addition & 1 deletion storage/replica_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (r *Replica) EndTransaction(batch engine.Engine, ms *engine.MVCCStats, args
var err error
if txnAutoGC && len(externalIntents) == 0 {
if log.V(1) {
log.Infof("auto-gc'ed %s", args.Txn.Short())
log.Infof("auto-gc'ed %s (%d intents)", args.Txn.Short(), len(args.Intents))
}
err = engine.MVCCDelete(batch, ms, key, proto.ZeroTimestamp, nil /* txn */)
} else {
Expand Down

0 comments on commit ec16f29

Please sign in to comment.