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

RAFT: fix race between apply for classes in the schema and report ready only after db reloaded #4946

Merged
merged 12 commits into from
May 16, 2024

Conversation

moogacs
Copy link
Contributor

@moogacs moogacs commented May 16, 2024

What's being changed:

this PR add a fix to handle data races on accessing the schema classes st.db.Schema.Classes
those situation can happen if there is concurrent apply at the same time and in this change we reload the db from introduced new func reloadDBFromSchema() which serialize access to schema classes

also convert dbLoaded flag to be set in reloadDBFromSchema() func only given that flag is used to report ready and in case of recovering we need to reload the db before reporting ready to have the consistent state for query

Review checklist

  • Documentation has been updated, if necessary. Link to changed documentation:
  • Chaos pipeline run or not necessary. Link to pipeline:
  • All new code is covered by tests where it is reasonable.
  • Performance tests have been run or not necessary.

reyreaud-l
reyreaud-l previously approved these changes May 16, 2024
@moogacs moogacs requested a review from a team as a code owner May 16, 2024 13:59
Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@moogacs moogacs changed the title RAFT: fix race between apply and snapshot for classes in the schema RAFT: fix race between apply for classes in the schema and report ready only after db reloaded May 16, 2024
@moogacs moogacs requested a review from reyreaud-l May 16, 2024 18:27
@antas-marcin antas-marcin merged commit 28101fd into stable/v1.25 May 16, 2024
42 checks passed
@antas-marcin antas-marcin deleted the fix-snapshot-apply-race branch May 16, 2024 18:50
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.

None yet

3 participants