Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv: properly mark r/o txns as committed #31599

Merged
merged 1 commit into from
Oct 18, 2018

Conversation

andreimatei
Copy link
Contributor

Readonly txns have a special commit path. This path wasn't marking the
txn as committed correctly, which had a couple of consequences:

  • db.Txn() would potentially try to commit again, in case the closure
    already did it
  • the txn.aborted metric was incremented

Fixes #31595

Release note: Fix a bug causing committed read-only txns to be counted
as aborted in the metrics.

Readonly txns have a special commit path. This path wasn't marking the
txn as committed correctly, which had a couple of consequences:
- db.Txn() would potentially try to commit again, in case the closure
already did it
- the txn.aborted metric was incremented

Fixes cockroachdb#31595

Release note: Fix a bug causing committed read-only txns to be counted
as aborted in the metrics.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm: thanks for the quick fix!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@craig
Copy link
Contributor

craig bot commented Oct 18, 2018

Build failed

@andreimatei
Copy link
Contributor Author

andreimatei commented Oct 18, 2018 via email

craig bot pushed a commit that referenced this pull request Oct 18, 2018
31599: kv: properly mark r/o txns as committed r=andreimatei a=andreimatei

Readonly txns have a special commit path. This path wasn't marking the
txn as committed correctly, which had a couple of consequences:
- db.Txn() would potentially try to commit again, in case the closure
already did it
- the txn.aborted metric was incremented

Fixes #31595

Release note: Fix a bug causing committed read-only txns to be counted
as aborted in the metrics.

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Oct 18, 2018

Build succeeded

@craig craig bot merged commit a85115a into cockroachdb:master Oct 18, 2018
@andreimatei andreimatei deleted the fix-txn-metrics branch October 19, 2018 22:11
craig bot pushed a commit that referenced this pull request Oct 19, 2018
31608: release-2.1: kv: properly mark r/o txns as committed r=andreimatei a=andreimatei

Backport 1/1 commits from #31599.

/cc @cockroachdb/release

---

Readonly txns have a special commit path. This path wasn't marking the
txn as committed correctly, which had a couple of consequences:
- db.Txn() would potentially try to commit again, in case the closure
already did it
- the txn.aborted metric was incremented

Fixes #31595

Release note: Fix a bug causing committed read-only txns to be counted
as aborted in the metrics.


Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
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.

3 participants