Skip to content

roachtest: Make election test work on release-2.0#26598

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
a-robinson:election-test
Jun 11, 2018
Merged

roachtest: Make election test work on release-2.0#26598
craig[bot] merged 1 commit intocockroachdb:masterfrom
a-robinson:election-test

Conversation

@a-robinson
Copy link
Copy Markdown
Contributor

The test was assuming the existence of a default database, which
isn't present in 2.0.

Fixes #26562

Release note: None

The test was assuming the existence of a default database, which
isn't present in 2.0.

Fixes cockroachdb#26562

Release note: None
@a-robinson a-robinson requested a review from bdarnell June 11, 2018 15:19
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@bdarnell
Copy link
Copy Markdown
Contributor

:lgtm:


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


Comments from Reviewable

@a-robinson
Copy link
Copy Markdown
Contributor Author

bors r+

1 similar comment
@a-robinson
Copy link
Copy Markdown
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Jun 11, 2018
23055: kv: stop concerning the TxnCoordSender with abandoned txns r=andreimatei a=andreimatei

Assorted cleanups of the client.Txn interface and the TxnCoordSender. See individual commits. The main point is the last one, which reads:


kv: stop concerning the TxnCoordSender with abandoned txns  …
Before this patch, the TxnCoordSender had a role in cleaning up
abandoned transactions, where abandoned was defined in a funky way:
1) for txns with a cancelable context, a txn was abandoned if the ctx
had been canceled.
2) for the other txns, the txn was considered abandoned if it ran for 10
seconds.

SQL only triggers 1).

The 10 second timeout was a relicv of the past, from a time where the
coordinator was possibly removed from the client. No more, they have
been collocated for years.
In fact, the whole idea of the TCS detecting abandoned txns is a relicv
of that past: all the txn users are already always cleaning up after
themselves.

The pressing motivation for this change is that there's an issue with
checking the context: there is currently no way to pass a ctx with the
same lifetime as the txn to the TxnCoordSender (as it is only a Sender).
And so the TCS was capturing the ctx of the first Send() op as the ctx
of the txn: this was a major hack that's a big problem - we can't have
per-statement contexts, for example. This also restricts the possible
implementations of statement cancelation: we have been forced to cancel
the whole transaction, which is not ideal.

This patch removes TCS' involvement in cleanup by relying on the client
to always send an EndTransaction. SQL was already doing that, as was
everybody else. The TCS is simplified.

The GCQueue maintains its role in detecting abandoned transactions - it
coninues to do so with an one hour timeout. This detection is needed, of
course, since the client is not collocated with the txn's range.

This patch removes the txn.Abandons metric which was maintained by the
TCS. There is a similar metric maintained by the GCQueue. The TCS one
was incorrect anyway, as it was being incremented on ctx cancelation.

Release note: None

26598: roachtest: Make election test work on release-2.0 r=a-robinson a=a-robinson

The test was assuming the existence of a default database, which
isn't present in 2.0.

Fixes #26562

Release note: None

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

craig bot commented Jun 11, 2018

Build succeeded

@craig craig bot merged commit 96546dd into cockroachdb:master Jun 11, 2018
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