-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add PostgreSQL database support #1238
base: main
Are you sure you want to change the base?
Conversation
I moved the PR back to draft status as I intend to make some changes to how the database backend works. Currently it uses transactions and restarts them if they fail which may result in unexpected data changes if the restarted transaction doesn’t re-read the current status. The file system backend uses locks to prevent concurrent access altogether. This can also be achieved in PostgreSQL with row level locks, so I want to switch to that strategy to have the same semantics in both backends. |
I’ve now changed how the database deals with concurrent access to mimic how the file system backend does things: There is a separate table for locks and whenever Now we need a bunch of testing … |
This PR adds support for using the PostgreSQL database as a storage backend for Krill in preparation for supporting fail-over scenarios for higher availability.
The PR integrates the storage abstraction previously implemented via the kvx crate back into Krill to allow a tight coupling of storage primitives with Krill’s requirements.
We have opted to not move the storage code to async functions as proposed in #1152. We think that storage should generally be fast enough that the gain from using async isn’t all that big. Using a thread pool and sync functions makes it easier to reason about what’s going on and should keep the code simpler.