Skip to content

kvserver: fix up multiTestContext clocks#45984

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:mtc
Mar 17, 2020
Merged

kvserver: fix up multiTestContext clocks#45984
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:mtc

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented Mar 11, 2020

multiTestContext is a piece of garbage. The particular shortcoming I'm
fixing here is that it was easy to accidentally mix manual and automatic
clocks. This would happen whenever passing a storeConfig in, which
by default comes with a real-time clock (whereas the mtc also has
m.clock, which is by default manual). Components using the store
config would use real time, but other components fake time.
You can imagine how this is not going to work well. In the particular
example motivating this PR, GC ran and set a real-time GC threshold,
so that heartbeats (which were using fake time) could never go through
as their manual timestamp didn't change in the wall time compoment
thanks to their underlying manual clock.

Now mtc will blow up more eagerly if you try to mix clocks like that -
you have to go all manual or all automatic (and nobody should choose
to go manual btw, this doesn't work very well).

Fixes #45814.

Release justification: test fix in non-production code.

Release note: None

multiTestContext is a piece of garbage. The particular shortcoming I'm
fixing here is that it was easy to accidentally mix manual and automatic
clocks. This would happen whenever passing a `storeConfig` in, which
by default comes with a real-time clock (whereas the mtc also has
m.clock, which is by default manual). Components using the store
config would use real time, but other components fake time.
You can imagine how this is not going to work well. In the particular
example motivating this PR, GC ran and set a real-time GC threshold,
so that heartbeats (which were using fake time) could never go through
as their manual timestamp didn't change in the wall time compoment
thanks to their underlying manual clock.

Now mtc will blow up more eagerly if you try to mix clocks like that -
you have to go all manual or all automatic (and nobody should choose
to go manual btw, this doesn't work very well).

Fixes cockroachdb#45814.

Release justification: test fix in non-production code.

Release note: None
@tbg tbg requested a review from nvb March 11, 2020 14:34
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Mar 16, 2020

Friendly ping.

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 10 of 10 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Mar 16, 2020

TFTR!
bors r=nvanbenschoten

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 16, 2020

Canceled (will resume)

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Mar 17, 2020

bors pls

bors r=nvanbenschoten

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Mar 17, 2020

bors r=nvanbenschoten

Come on bors

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 17, 2020

Build succeeded

@craig craig bot merged commit 3587336 into cockroachdb:master Mar 17, 2020
OwenQian pushed a commit to OwenQian/cockroach that referenced this pull request Mar 21, 2020
…t of

\cockroachdb#45984, which changed the behavior of multiTestContext to use a real-time
clock if it wasn't explicitly set to a manual clock.

Release justification: Deflake test in non-production code.
Release note: None.
craig bot pushed a commit that referenced this pull request Mar 21, 2020
46373: deflake TestStoreRangeMergeRaftSnapshot by using a manual clock r=tbg a=OwenQian

This test became flaky after #45984, which changed the behavior of multiTestContext to use a real-time clock if it wasn't explicitly set to a manual clock.

Fixes #46192.

Release justification: Deflake test in non-production code.

Release note: None.

Co-authored-by: Owen Qian <owenq@cockroachlabs.com>
nvb added a commit to nvb/cockroach that referenced this pull request Mar 23, 2020
Fixes cockroachdb#46215.

Fallout from cockroachdb#45984.

Release justification: testing only
Release note: None.
craig bot pushed a commit that referenced this pull request Mar 23, 2020
46408: opt: fix buggy EliminateUpsertDistinctOnNoColumns rule r=andy-kimball a=andy-kimball

The fix for #37880 added a new ErrorOnDup field to the UpsertDistinctOn
operator. However, the EliminateErrorDistinctNoColumns rule wasn't changed
to respect this flag, and so there's still a case where ON CONFLICT DO
NOTHING returns an error.

This commit eliminates the error by separating out the ErrorOnDup=True case
from the EliminateErrorDistinctNoColumns rule (which raises an error) and
adding it instead to the EliminateDistinctNoColumns rule (which does not
raise an error).

Fixes #46395

Release justification: Bug fixes and low-risk updates to new functionality.
This was always an error, so it's low-risk to make it a non-error.

Release note: None

46431: kv: don't disable the merge queue needlessly in more tests r=nvanbenschoten a=nvanbenschoten

Follow up to #46383.

These tests were disabling the queue to not interfere with its
AdminSplits, but since the tests were written, AdminSplit got
a TTL.

Release note: None
Release justification: test only

46433: kv: re-enable merge queue in TestSplitTriggerRaftSnapshotRace r=nvanbenschoten a=nvanbenschoten

The merge queue was disabled in this test by df26cf6 due to the bug
found in #32784. That bug was fixed by #33312, so we can address the
TODO and re-enable merges in the test.

Release note: None
Release justification: test only

46444: kv: deflake TestRangeInfo by using a manual clock r=nvanbenschoten a=nvanbenschoten

Fixes #46215.

Fallout from #45984.

Release justification: testing only
Release note: None.

Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.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.

kv/kvserver: TestStoreRangeUpReplicate failed

3 participants