Skip to content

Implement and unittest EndTransaction.#60

Merged
spencerkimball merged 1 commit intomasterfrom
spencerkimball/end-transaction
Sep 15, 2014
Merged

Implement and unittest EndTransaction.#60
spencerkimball merged 1 commit intomasterfrom
spencerkimball/end-transaction

Conversation

@spencerkimball
Copy link
Copy Markdown
Member

Added an implementation for EndTransaction which attempts to move a
transaction from PENDING to either COMMITTED or ABORTED depending on
the EndTransactionRequest.Commit argument. Various error conditions
may result, including the txn already being committed or aborted,
Epoch or timestamp regressions, or transaction retry on SSI txns
in the event that the commit timestamp is different from the transaction
timestamp.

Added an implementation for EndTransaction which attempts to move a
transaction from PENDING to either COMMITTED or ABORTED depending on
the EndTransactionRequest.Commit argument. Various error conditions
may result, including the txn already being committed or aborted,
Epoch or timestamp regressions, or transaction retry on SSI txns
in the event that the commit timestamp is different from the transaction
timestamp.
@spencerkimball
Copy link
Copy Markdown
Member Author

@bdarnell @Tobstar87

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meaning the other txn is aborted "or got pushed"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, where you have a write/write conflict, the only real success outcome (except that other transaction is already committed or aborted) is to abort the transaction. Only read/write conflicts are resolved by pushing the existing transaction's commit timestamp forward.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, yes. my fault.

@jiangmingyang
Copy link
Copy Markdown
Contributor

LGTM

spencerkimball added a commit that referenced this pull request Sep 15, 2014
@spencerkimball spencerkimball merged commit 1f65b2f into master Sep 15, 2014
@spencerkimball spencerkimball deleted the spencerkimball/end-transaction branch September 15, 2014 19:02
soniabhishek pushed a commit to soniabhishek/cockroach that referenced this pull request Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants