Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3319 +/- ##
=============================================
- Coverage 64.24% 31.47% -32.77%
+ Complexity 10398 5982 -4416
=============================================
Files 840 941 +101
Lines 71755 81419 +9664
Branches 8611 9899 +1288
=============================================
- Hits 46099 25628 -20471
- Misses 23004 53693 +30689
+ Partials 2652 2098 -554 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c31e416 to
593cef4
Compare
593cef4 to
4113a55
Compare
Bound preparation and publication to one exact retirement intent per named DB instance. Limit the writer checkout read timeout and evict connections that cannot be safely returned. Use synchronous MySQL timeout updates in the fault-injection fixture. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0c64636 to
574a099
Compare
| private final MySqlNamedBlobDbConfig config; | ||
| private final Metrics metricsRecoder; | ||
| // Reserve one worst-case encoded request (32 MiB), including while its caller decides whether to retry. | ||
| private final Semaphore retirementSlot = new Semaphore(1); |
There was a problem hiding this comment.
With Semaphore(1) (and the single worker in #3320), each frontend host runs only one retirement at a time. The slot is held during descriptor fetches (router IO for up to 32 roots) and the commit, so one DELETE can take seconds, and parallel S3 deletes will mostly get 503. Is that the intended throughput? Would N permits sized by a memory budget (encoded bytes), plus a rejection metric, work instead?
| throws SQLException { | ||
| root = pending.root.toBytes(); | ||
| count = pending.expected; | ||
| body = encode(pending.descriptors, count, root); |
There was a problem hiding this comment.
Design question (the format comes from the merged #3313): the full child list is copied into MySQL, about 50 B per child, so roughly 13 KB per 1 GB file and up to about 13 MB (cap 32 MiB) for 262,144 chunks. That affects max_allowed_packet, binlog/replication lag, backups, and transaction size. The root metadata blob already holds this list, and retirement never deletes it. Did we consider storing only root ID + hash and having reclamation read the root, or writing the list to a separate blob? Also, will manifest rows ever be purged after reclamation?
| } | ||
| if (cur instanceof SQLNonTransientConnectionException || cur instanceof SQLTransientConnectionException) { | ||
| if (cur instanceof SQLNonTransientConnectionException || cur instanceof SQLTransientConnectionException | ||
| || cur instanceof SocketTimeoutException || cur instanceof SocketException || cur instanceof EOFException) { |
There was a problem hiding this comment.
Adding SocketException / EOFException / SocketTimeoutException here also changes connectionFailureCount for all non-retirement paths. Is that intended? Existing alerts or dashboards on this metric may shift.
| } | ||
|
|
||
| private void returnConnection(Connection connection, boolean autoCommit, Throwable operationFailure) { | ||
| private static JdbcConnection requireFixedRetirementSession(Connection connection) throws SQLException { |
There was a problem hiding this comment.
This relies on Connector/J internals (ConnectionImpl, getServerSession().inTransactionOnServer(), the property set). A driver upgrade could silently break it or make every retirement fail closed. Can we add a test that would catch a driver change here?
There was a problem hiding this comment.
Also, is the prod writer pool already configured this way (Connector/J, no proxy, autoReconnect=false, REPEATABLE READ)? If not, every retirement in the enabled namespace will 503; can we validate this at startup when the namespace config is set, instead of failing per request?
SophieGuo410
left a comment
There was a problem hiding this comment.
Thanks. The exact-intent handle and the "absent receipt is not a rollback" handling look right to me. A few questions and concerns are inline.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Review the bounded-retirement diff. This is part of the Liquid large-delete work.
Start with
MySqlNamedBlobDb.Retirementfor admission and recovery;NamedBlobManifestStoreowns the exact-intent encoding. The format and atomic publication are unchanged. The writer needs a fixed Connector/J session with reconnect disabled andREPEATABLE READ. Retirement caps socket read time only on its own checkout and discards broken connections without trying to roll back. Ordinary requests retain the pool's existing timeout. The read timeout does not cap total attempt time, and the admission limit bounds encoded bytes, not peak heap. Public DELETE, production DDL, and reclamation are out of scope.Retirement transport failures and busy rejections have separate counters. The existing named DB connection-failure counter is unchanged for ordinary operations. The runbook covers payload and replication sizing and explains why manifest removal needs its own retention policy.
Testing Done
./gradlew --offline --no-daemon :ambry-named-mysql:test --tests com.github.ambry.named.MySqlNamedBlobDbTest :ambry-named-mysql:intTest --tests com.github.ambry.named.NamedBlobManifestStoreIntegrationTest— 25 unit tests and 39 of 40 isolated MySQL tests passed; the reconnect test hit a fixture issue../gradlew --offline --no-daemon :ambry-named-mysql:intTest --tests 'com.github.ambry.named.NamedBlobManifestStoreIntegrationTest.testRetirementRejectsConnectorJReconnectOptions'— passed after correcting the fixture. The local MySQL run does not verify the deployed writer configuration.Generated with GitHub Copilot CLI