Skip to content

kv: fix intent tracking#26606

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:fix-intent-tracking
Jun 12, 2018
Merged

kv: fix intent tracking#26606
craig[bot] merged 1 commit intocockroachdb:masterfrom
andreimatei:fix-intent-tracking

Conversation

@andreimatei
Copy link
Copy Markdown
Contributor

I've introduced a bug in #26497 - if there's concurrent writing requests
going though a single client.Txn, it can be that some of the intents
are not tracked correctly. Before this patch, intents started being
tracked when the TxnCoordSender sees a BeginTransaction. Even through
the client.Txn attaches an EndTransaction to the first writing requests
that it sees, a 2nd request might pass through and get to the
TxnCoordSender before that BeginTxn. In fact, it might even get a
response before the TxnCoordSender sees the BeginTxn, in which case we
wouldn't have recorded its intents.
This patch makes the TxnCoordSender track intents from all writing
requests. The BeginTxn doesn't matter for tracking intents any more. It
continues to matter for starting the heartbeat loop. We could
alternatively move to starting the hb loop when seeing the first write,
but I didn't do it.

Fixes #26538

Release note: None

I've introduced a bug in cockroachdb#26497 - if there's concurrent writing requests
going though a single client.Txn, it can be that some of the intents
are not tracked correctly. Before this patch, intents started being
tracked when the TxnCoordSender sees a BeginTransaction. Even through
the client.Txn attaches an EndTransaction to the first writing requests
that it sees, a 2nd request might pass through and get to the
TxnCoordSender before that BeginTxn. In fact, it might even get a
response before the TxnCoordSender sees the BeginTxn, in which case we
wouldn't have recorded its intents.
This patch makes the TxnCoordSender track intents from all writing
requests. The BeginTxn doesn't matter for tracking intents any more. It
continues to matter for starting the heartbeat loop. We could
alternatively move to starting the hb loop when seeing the first write,
but I didn't do it.

Fixes cockroachdb#26538

Release note: None
@andreimatei andreimatei requested review from a team June 11, 2018 20:25
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@bdarnell
Copy link
Copy Markdown
Contributor

:lgtm:


Reviewed 3 of 3 files at r1.
Review status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)


Comments from Reviewable

@andreimatei
Copy link
Copy Markdown
Contributor Author

bors r+


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


Comments from Reviewable

craig bot pushed a commit that referenced this pull request Jun 12, 2018
26606: kv: fix intent tracking r=andreimatei a=andreimatei

I've introduced a bug in #26497 - if there's concurrent writing requests
going though a single client.Txn, it can be that some of the intents
are not tracked correctly. Before this patch, intents started being
tracked when the TxnCoordSender sees a BeginTransaction. Even through
the client.Txn attaches an EndTransaction to the first writing requests
that it sees, a 2nd request might pass through and get to the
TxnCoordSender before that BeginTxn. In fact, it might even get a
response before the TxnCoordSender sees the BeginTxn, in which case we
wouldn't have recorded its intents.
This patch makes the TxnCoordSender track intents from all writing
requests. The BeginTxn doesn't matter for tracking intents any more. It
continues to matter for starting the heartbeat loop. We could
alternatively move to starting the hb loop when seeing the first write,
but I didn't do it.

Fixes #26538

Release note: None

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

craig bot commented Jun 12, 2018

Build succeeded

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.

4 participants