Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Audit and harden concurrent access to SCP history tables used during consensus and publishing #4589

Open
marta-lokhova opened this issue Dec 19, 2024 · 0 comments
Labels
bug docs issue/PR that affects documentation

Comments

@marta-lokhova
Copy link
Contributor

Currently in master scphistory and scpquorums are accessed concurrently:

  • SCP history is written during consensus on the main thread (append-only)
  • During publish, SCP history is queried from the background thread (select rows)
  • During maintenance, SCP history is deleted (delete rows)

This seems to work as we haven't run into a single serialization issue for years (probably because we don't touch the same rows), but it's definitely a footgun. If we change any of these queries, we may run into concurrent DB access errors (and triggering those might be quite difficult, so hard to say when it'd get discovered)

We should:

  • Confirm this actually works
  • Write documentation on these queries
  • Consider just doing checkpoint building on the main thread. Tx history maintenance burden has been significantly reduced as of v22.1.0, so it seems plausible we could construct the checkpoint on the main thread without much overhead.
@marta-lokhova marta-lokhova added bug docs issue/PR that affects documentation labels Dec 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug docs issue/PR that affects documentation
Projects
None yet
Development

No branches or pull requests

1 participant