Skip to content
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

server/settingswatcher: track timestamps so values do not regress #87564

Conversation

ajwerner
Copy link
Contributor

@ajwerner ajwerner commented Sep 8, 2022

A rangefeed is allowed to send previously seen values. When it did, it would result in the observed value of a setting regressing. There's no need for this: we can track some timestamps and ensure we do not regress.

Fixes #87502

Relates to #87201

Release note (bug fix): In rare cases, the value of a cluster setting could regress soon after it was set. This no longer happens for a given gateway node.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner
Copy link
Contributor Author

ajwerner commented Sep 8, 2022

Ignore the failed tests, this is RFAL

@ajwerner ajwerner requested a review from dt September 8, 2022 14:35
s.mu.Lock()
defer s.mu.Unlock()
if existing, ok := s.mu.values[name]; ok && sv.ts.Less(existing.ts) {
return
Copy link
Member

Choose a reason for hiding this comment

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

nit: a comment here (or on the func) as to why it'd be out of order might be nice; I'd ague I'd have expected it here more than on the struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@HonoreDB HonoreDB left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner, @dt, and @HonoreDB)

@ajwerner ajwerner force-pushed the ajwerner/make-settings-watcher-handle-stale-updates branch from 9583140 to 8769b3b Compare September 8, 2022 20:52
@ajwerner
Copy link
Contributor Author

ajwerner commented Sep 8, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 8, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 9, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 9, 2022

Build failed:

A rangefeed is allowed to send previously seen values. When it did, it would
result in the observed value of a setting regressing. There's no need for this:
we can track some timestamps and ensure we do not regress.

Fixes cockroachdb#87502

Relates to cockroachdb#87201

Release note (bug fix): In rare cases, the value of a cluster setting could
regress soon after it was set. This no longer happens for a given gateway node.
@ajwerner ajwerner force-pushed the ajwerner/make-settings-watcher-handle-stale-updates branch from 8769b3b to ffea578 Compare September 9, 2022 03:39
@ajwerner
Copy link
Contributor Author

ajwerner commented Sep 9, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 9, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 9, 2022

Build succeeded:

@craig craig bot merged commit a79439e into cockroachdb:master Sep 9, 2022
@ajwerner
Copy link
Contributor Author

ajwerner commented Sep 9, 2022

This turns out to matter for testing.

blathers backport 22.2

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.

sql: TestTenantLogic_create_index timed out
4 participants