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

admin: remove need for direct db connection by creating/using equivalent SA methods #7350

Open
aarongable opened this issue Mar 4, 2024 · 0 comments
Assignees

Comments

@aarongable
Copy link
Contributor

This is a request from SRE so that the new admin tool can be more easily deployed, without needing a direct DB connection or a proxysql instance.

@aarongable aarongable added this to the Sprint 2024-03-05 milestone Mar 5, 2024
@aarongable aarongable self-assigned this Mar 5, 2024
aarongable added a commit that referenced this issue Mar 11, 2024
Add two new methods to the SA, GetSerialsByKey and GetSerialsByAccount,
which use the same query as the admin tool has previously used to get
serials matching a given SPKI hash or a given registration ID. These two
new gRPC methods read the database row-by-row and produce streams of
results to keep SA memory usage low.

Use these methods in the admin tool so it no longer needs a direct
database connection for these actions.

Part of #7350
aarongable added a commit that referenced this issue Mar 11, 2024
Use two existing SA methods, KeyBlocked and GetSerialsByKey, to replace
the direct database access previously used by the blockSPKIHash method.
This is less efficient than before -- it now streams the whole set of
affected serials rather than just counting them -- but doing so prevents
us from needing an additional SA method just for counting.

Also update the default mock StorageAuthority and
StorageAuthorityReadOnly provided by the mocks package to return actual
stream objects (which stream zero results) instead of nil, so that tests
can attempt to read from the resulting stream without getting a nil
pointer exception.

Part of #7350
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

No branches or pull requests

1 participant