-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
backupccl: fix flake in TestProtectedTimestampDuringBackup #47582
Conversation
// This regex matches when all float priorities other than 0.00000. | ||
matchNonZeroSmall := "0\\.\\d*[1-9]" // matches 0.00123, 0.00001 | ||
matchNonZeroLarge := "[1-9]\\d*(\\.\\d+)?" // matches 123.000, 123.2, and 1234 | ||
nonZeroProgressRE := regexp.MustCompile(fmt.Sprintf("priority=(%s|%s)", matchNonZeroSmall, matchNonZeroLarge)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to simplify this, but this was the best I could come up with given that Go's regex doesn't support negative lookahead... if any ideas come to mind, I'm open to suggestions. :)
pkg/ccl/backupccl/backup_test.go
Outdated
@@ -3669,11 +3676,14 @@ func TestProtectedTimestampsDuringBackup(t *testing.T) { | |||
|
|||
// Wait for the ranges to learn about the removed record and ensure that we | |||
// can GC from the range soon. | |||
gcRanRE := regexp.MustCompile("(?s)shouldQueue=true.*processing replica.*GC score after GC") | |||
// This regex matches when all float priorities other than 0.00000. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about: [1-9]\d*\.\d+|0\.\d*[1-9]\d*
❌ The GitHub CI (Cockroach) build has failed on 5d90c485. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
This commit is purely a change for readability. It releases the timestamp during the backup job before sending the result over the channel. I don't expect this to have any functional change, but it improves readability as returning the result channel is typically the last important thing we want to do in a job. Release note: None
5d90c48
to
130e8b1
Compare
❌ The GitHub CI (Cockroach) build has failed on 130e8b11. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
130e8b1
to
6dffd2d
Compare
TestProtectedTimestampDuringBackup would sometimes flake as the GC queue would assign it a low priority that would be below the threshold to turn shouldQueue to true. However, the priority is non-zero indicating that the timestamp was indeed not protected. This change aims to remove the flake by checking for a non-zero priority rather than if shouldQueue is true. Release note: None
Similar to the previous commit, this commit changes the test to wait for a non-zero priority for this range in the GC queue. Although we've never seen this flake in practice, it is potentially susceptible to the same flake that has been seen in TestProtectedTimestampDuringBackup. Release note: None
6dffd2d
to
ea40b2f
Compare
Updated the regex - RFAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, 1 of 1 files at r5, 1 of 1 files at r6.
Reviewable status: complete! 1 of 0 LGTMs obtained
TFTR! |
Build failed (retrying...) |
Build succeeded |
TestProtectedTimestampDuringBackup would sometimes flake as the GC queue
would assign it a low priority that would be below the threshold to turn
shouldQueue to true. However, the priority is non-zero indicating that
the timestamp was indeed not protected. This change aims to remove the
flake by checking for a non-zero priority rather than if shouldQueue is
true.
This PR also makes the same change to the ImportInto variant of the test since
they share the same test structure.
Fixes #47522.
Release note: None