apply TypeConverter to args in transactions#12
Merged
beautifulentropy merged 1 commit intomainfrom Nov 18, 2025
Merged
Conversation
dd6cb8c to
1a5eceb
Compare
1a5eceb to
4ef2759
Compare
aarongable
approved these changes
Nov 18, 2025
jsha
approved these changes
Nov 18, 2025
beautifulentropy
added a commit
to letsencrypt/boulder
that referenced
this pull request
Nov 19, 2025
…erter (#8494) Today, timestamp truncation happens for queries using `*borp.DbMap` but not `*borp.Transaction`. That means comparisons still see sub-seconds, but inserts into MariaDB `DATETIME` columns silently truncate them to whole seconds. On MySQL 8, the same queries will still include sub-seconds, but inserts into `DATETIME` columns will round to the nearest second instead of truncate. This leads to issues for queries like the one in `*StorageAuthority.UpdateCRLShard()`. When two CRL updaters write within the same second one may be rounded up to the next second. When the other updater attempts its own `UPDATE .. WHERE thisUpdate <= ?`, the condition fails because the stored timestamp now appears to be in the future. Ahead of the transition from ProxySQL + MariaDB to Vitess + MySQL 8 in #8468, update borp (letsencrypt/borp#12) to expose Transaction arguments to the BoulderTypeConverter, allowing it to truncate all timestamps passed through Transactions and keep behavior consistent across `*borp.DbMap` and `*borp.Transaction`, as well as MariaDB and MySQL 8. Part of #7736
npurtova
pushed a commit
to plesk/boulder
that referenced
this pull request
Nov 25, 2025
…erter (letsencrypt#8494) Today, timestamp truncation happens for queries using `*borp.DbMap` but not `*borp.Transaction`. That means comparisons still see sub-seconds, but inserts into MariaDB `DATETIME` columns silently truncate them to whole seconds. On MySQL 8, the same queries will still include sub-seconds, but inserts into `DATETIME` columns will round to the nearest second instead of truncate. This leads to issues for queries like the one in `*StorageAuthority.UpdateCRLShard()`. When two CRL updaters write within the same second one may be rounded up to the next second. When the other updater attempts its own `UPDATE .. WHERE thisUpdate <= ?`, the condition fails because the stored timestamp now appears to be in the future. Ahead of the transition from ProxySQL + MariaDB to Vitess + MySQL 8 in letsencrypt#8468, update borp (letsencrypt/borp#12) to expose Transaction arguments to the BoulderTypeConverter, allowing it to truncate all timestamps passed through Transactions and keep behavior consistent across `*borp.DbMap` and `*borp.Transaction`, as well as MariaDB and MySQL 8. Part of letsencrypt#7736
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend the TypeConverter functionality added to
*DbMapmethods in #11 to*Transactionmethods as well.