Skip to content

release-21.2: sql: deflake TestSavepoints#73492

Closed
blathers-crl[bot] wants to merge 1 commit intorelease-21.2from
blathers/backport-release-21.2-73388
Closed

release-21.2: sql: deflake TestSavepoints#73492
blathers-crl[bot] wants to merge 1 commit intorelease-21.2from
blathers/backport-release-21.2-73388

Conversation

@blathers-crl
Copy link
Copy Markdown

@blathers-crl blathers-crl bot commented Dec 6, 2021

Backport 1/1 commits from #73388 on behalf of @nvanbenschoten.

/cc @cockroachdb/release


Fixes #70220.
Fixes #72911.

This commit deflakes TestSavepoints by running the manipulation of the
progress table in a separate SQL connection. This connection is not
subject to the lock_timeout or any other session settings that may be
configured on the other SQL connections in the test.


Release justification: testing fix.

Fixes #70220.
Fixes #72911.

This commit deflakes `TestSavepoints` by running the manipulation of the
`progress` table in a separate SQL connection. This connection is not
subject to the lock_timeout or any other session settings that may be
configured on the other SQL connections in the test.
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-21.2-73388 branch from 564db12 to 03d6863 Compare December 6, 2021 03:04
@blathers-crl blathers-crl bot requested review from andreimatei, nvb and rytaft December 6, 2021 03:04
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Dec 6, 2021
@blathers-crl
Copy link
Copy Markdown
Author

blathers-crl bot commented Dec 6, 2021

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues or test-only changes.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@nvb
Copy link
Copy Markdown
Contributor

nvb commented Dec 6, 2021

Closing. See #73494.

@nvb nvb closed this Dec 6, 2021
craig bot pushed a commit that referenced this pull request Dec 6, 2021
73475: kvclient: cleanup legacy TxnHeartbeating field r=andreimatei a=andreimatei

This field indicates whether the txn heartbeat loop started. 21.2 is not
reading this field; it's only writing it for compatibility with 21.1.
So, it's no longer needed since we're working towards 22.1.

Release note: None

73478: rangecache: fix a span use-after-Finish r=andreimatei a=andreimatei

Lookups of range descriptors use a form of pretty unusual unstructured
concurrency: a request spawns a goroutine that might outlive it (in case
the request is canceled), but at the same time the goroutine wants to be
part of the same trace as the request. Before this patch, the goroutine
was responsible for forking the request's span asynchronously. This was
pretty broken because the request's span might be finished by the time
it's forked. This is a use-after-Finish, and I'm trying to stop
tolerating such uses. This patch fixes it by forking the span
synchronously.

Release note: None

73494: sql: actually deflake TestSavepoints r=nvanbenschoten a=nvanbenschoten

This PR rolls back #73388 and reworks the fix for #70220. #73388 was an incorrect fix because the test relies on the progress table being updated in the same transaction as the rest of the SQL logic. This ensures that progress updates are rolled back when the rest of the transaction is rolled back. I didn't catch this in the initial PR because I missed the fact that the test had been skipped on `master`, so the test appeared to be passing with the change. When I then tried to backport the change in #73492, CI caught the mistake.

The PR then deflakes `TestSavepoints` by increasing the lock timeout significantly (from 1ms to 100ms) in the `rollback_after_lock_timeout` subtest. The test was flaky because after the transaction hits a lock timeout error, it performs an async rollback. If this async rollback hasn't grabbed latches by the time the next txn retry (with a different txn ID) finishes waiting out the lock_timeout when attempting to write to its progress, a lock timeout error would be thrown. This commit makes this extremely unlikely by increasing the lock timeout from 1ms to 100ms. With this new timeout, I've never seen the test flake under stress.

73515: roachtest: fix pgjdbc unexpected pass for ArrayTest in 22.1 r=rafiss a=ZhouXing19

fixes #73298

Release note: None

73525: kv/kvnemesis: skip TestKVNemesisSingleNode r=irfansharif a=irfansharif

Refs: #73373

Reason: flaky test

Generated by bin/skip-test.

Release justification: non-production code changes

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Co-authored-by: Jane Xing <zhouxing@uchicago.edu>
Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
@rafiss rafiss deleted the blathers/backport-release-21.2-73388 branch June 22, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants