Skip to content

Commit

Permalink
storage/engine: add TxnMinTimestamp field to MVCCWriteIntentOp
Browse files Browse the repository at this point in the history
This cleans up the handling of minimum timestamp in the rangefeed processor.

The migration story here is relatively straightforward. If an MVCCWriteIntentOp
doesn't have a MinTimestamp then we know that we're in one of the following
three cases:

1. the coordinator for the transaction is a v19.1 node and did
   not assign a MinTimestamp to its transaction
2. an initResolvedTSScan found an intent without a MinTimestamp
3. the leaseholder that created the operation is a v19.1 node and
   did not propagate the transaction's MinTimestamp. The coordinator
   may be a v19.1 or v19.2 node

The first and second case imply that the transaction coordinator will never
interact with a v20.1 node. This means that the migration story discussed in
SynthesizeTxnFromMeta will work well. The third case is more complicated
because the leaseholder who proposed the MVCCWriteIntentOp might not be around
any more. This means that by the time the MVCCWriteIntentOp results in a PushTxn
request, the request may go to a v20.1 node even when the transaction's coordinator
is still alive. In that case, the migration in SynthesizeTxnFromMeta isn't
exactly what we want, but it also won't cause correctness issues. The worst
thing that can happen is that we'll abort the transaction, which we were likely
already going to do anyway.

Release note: None
  • Loading branch information
nvanbenschoten committed Jul 10, 2019
1 parent 9bace21 commit ef375ae
Show file tree
Hide file tree
Showing 11 changed files with 340 additions and 177 deletions.
49 changes: 48 additions & 1 deletion c-deps/libroach/protos/storage/engine/enginepb/mvcc3.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions c-deps/libroach/protos/storage/engine/enginepb/mvcc3.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef375ae

Please sign in to comment.