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: fix race in TestCachedSettingsServerRestart. #130346

Merged

Conversation

shubhamdhama
Copy link
Contributor

Before this change, we picked the expected value without waiting for all settings to be updated in the cache. This could lead to a race condition in rare cases where the settings watcher had not yet received some of the settings through rangefeed. We would assign those incomplete settings to expectedSettingsCount, and just before stopping the server, the settings cache would receive the remaining ones.

Informs: #124419. We haven't seen this issue on the current master yet, likely due to some improvements in rangefeed performance. This fix will be backported.

Epic: CRDB-38882
Release note: None

Before this change, we picked the expected value without waiting for all
settings to be updated in the cache. This could lead to a race condition
in rare cases where the settings watcher had not yet received some of the
settings through rangefeed. We would assign those incomplete settings to
`expectedSettingsCount`, and just before stopping the server, the settings
cache would receive the remaining ones.

Informs: cockroachdb#124419. We haven't seen this issue on the current master yet,
likely due to some improvements in rangefeed performance. This fix will be
backported.

Epic: CRDB-38882
Release note: None
@shubhamdhama shubhamdhama requested a review from a team as a code owner September 9, 2024 17:49
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@shubhamdhama
Copy link
Contributor Author

Fixing this issue in master doesn't harm but just an fyi this issue only happens in 23.1.x.

Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

:lgtm:

Thanks for digging into this!

@shubhamdhama
Copy link
Contributor Author

Thanks for the review!

bors r=stevendanna

@craig craig bot merged commit 31794d8 into cockroachdb:master Sep 12, 2024
23 checks passed
@shubhamdhama
Copy link
Contributor Author

blathers backport 23.1

Copy link

blathers-crl bot commented Sep 13, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 29ec4fd to blathers/backport-release-23.1-130346: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

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