Skip to content

Only store IssuanceChain if not cached #1679

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

Merged

Conversation

robstradling
Copy link
Contributor

@robstradling robstradling commented Mar 21, 2025

If an IssuanceChain is already present in CTFE's LRU cache, then we know it must also already be stored on the database. Since a cache lookup is less expensive than a database write (that we know will fail with a duplicate key exception), it makes sense to check the cache and then only perform the database write if the IssuanceChain is not present in the cache.

Checklist

@robstradling robstradling force-pushed the only_store_issuancechain_if_not_cached branch from 3928f69 to 90b3f4c Compare March 21, 2025 12:29
@roger2hk
Copy link
Contributor

/gcbrun

1 similar comment
@AlCutter
Copy link
Member

/gcbrun

@robstradling robstradling force-pushed the only_store_issuancechain_if_not_cached branch from 5fd1a6d to 92cdb3c Compare March 24, 2025 11:50
@robstradling robstradling marked this pull request as ready for review March 24, 2025 11:51
@robstradling robstradling requested a review from a team as a code owner March 24, 2025 11:51
@robstradling robstradling requested review from phbnf and removed request for a team March 24, 2025 11:51
@roger2hk
Copy link
Contributor

/gcbrun

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Contributor

@roger2hk roger2hk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should greatly reduce the data transfer between CTFE and the database for add[-pre]-chain requests. Thanks, @robstradling!

@roger2hk roger2hk merged commit 4eb2491 into google:master Mar 24, 2025
9 checks passed
@robstradling robstradling deleted the only_store_issuancechain_if_not_cached branch March 24, 2025 14:22
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.

4 participants