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

Use async storage #1101

Open
timbru opened this issue Sep 2, 2023 · 1 comment
Open

Use async storage #1101

timbru opened this issue Sep 2, 2023 · 1 comment

Comments

@timbru
Copy link
Contributor

timbru commented Sep 2, 2023

Update Krill to use async kvx (see NLnetLabs/kvx#15)

Currently, we do not use async functions for kvx. This also still needs some work in kvx itself.

Under the hood, postgres is accessed using async, but as it's currently hidden behind a sync interface, it uses its own runtime for this. This leads to issues if we call this from async code.

This means that for the moment we cannot postgres as a kvx instance.

The async kvx code itself is not overly complicated, but using it in Krill presents some challenges. Essentially we need to update AggregateStore and WalStore to use async functions for manipulating entities: creating, getting, sending commands.

Unfortunately, this means that the command processing by Aggregates and WalSupport types also needs to become async. This is mainly because various entities (like CAs) need access to the signer. But the signer is in fact a complex beast that supports multiple singer implementations - the correct implementation is looked up at runtime but for this we need the latest signer instance, which means we need async access to the storage layer.

Furthermore, we implemented pkri::crypto::Signer on the SignerRouter which is used for this routing logic. And that trait is sync. So either we need an async_trait signer in rpki, or we need to work around this in Krill - i.e. we look up the correct signers etc async, and then call the actual signing code in rpki-rs once we have it. The latter is probably easier as we already provide high-level functions in Krill (e.g. sign ROA, ASPA etc).

@timbru
Copy link
Contributor Author

timbru commented Dec 7, 2023

See PR #1152. The relevant kvx code was imported into Krill and supports async in that PR. There is no database implementation ported, but that can be added in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Status: server scaling
Development

No branches or pull requests

1 participant