Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions ambry-named-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,27 @@ the source of the list; repeated child IDs retain their positions. Prepare the l
manifest and retire the named versions in one transaction. A crash before commit leaves neither a manifest nor a
retirement.

Before dispatch, retain the original named-version keys, each root ID, and its ordered child IDs. If the commit reply is
lost, check that exact request on the authoritative writer. A match confirms the commit; it does not authorize cleanup.
No match means the commit was not observed, not that it rolled back. Retry only the original request. If the inputs are
unavailable, stop. Never resolve the current name to reconstruct the request or fall back to the router's ordinary delete.
`prepareRetirement` resolves the account and container once and reserves one request per named DB instance before
invoking the descriptor supplier. Supply the exact named versions and roots, and defer descriptor work to the supplier.
Preparation, publication, and receipt checks block; run them off the event loop. There is no payload queue. Close the
handle on all paths: while it is open, a second request is rejected as unavailable. The 32 MiB limit is on encoded child
bytes, not peak heap: allow for encoding buffers, supplier memory, and JDBC packet buffers. Publication or confirmation
can also occupy one connection from the same pool as ordinary requests, outside the transaction executor.
`RetirementWriterBusyCount` records admission rejections; use it with heap and writer load before changing concurrency.

Use the same handle to publish, to check its receipt after an uncertain result, and to retry. Each call checks out an
idle, autocommit `REPEATABLE READ` session from the configured local writer pool and starts a fresh transaction.
Publication and confirmation require a fixed Connector/J connection with reconnect disabled. The retirement checkout
caps socket reads at five seconds and restores the previous timeout before returning a healthy connection. Do not set a
pool-wide `socketTimeout` for retirement. Socket or communications failures discard the checkout without a rollback
attempt; an interrupted commit is still an unknown outcome. Configure bounded pool checkout and descriptor fetches.
The read timeout is not an end-to-end deadline, and closing the handle does not interrupt an active call.
`RetirementConnectionFailureCount` tracks retirement transport failures separately from ordinary named DB connections.

A matching receipt confirms the commit; it does not authorize cleanup. No match means the commit was not observed, not
that it rolled back. A replay whose read snapshot predates a concurrent commit can still reject if replacements now
exceed the range cap; confirm again in a fresh transaction. If the original inputs are unavailable, stop. Never resolve
the current name to reconstruct the request or use the router's ordinary delete.

A reader with a saved tuple can recover the published list after a restart without fetching the original root.
Configure the reader data source for `READ COMMITTED` or stronger on every checkout.
Expand All @@ -35,6 +52,10 @@ Connector/J 8.0.21 with client-side prepared statements rejected a synthetic 32
the measured query exceeded 64 MiB before transmission. The same bytes round-tripped with server-side prepared
statements at 64 MiB and with either mode at 128 MiB on local MySQL 8.0.46. These are tested configurations, not
production settings. Check the client limit as well as MySQL and replication limits on each deployment.
Measure binlog growth, replica lag, transaction size and backup growth under a representative workload. A root ID and
hash cannot recover descriptors if the raw root expires or becomes unreadable. Storing descriptors separately would
require keeping that object available and reconciling its lifecycle with MySQL publication. There is no manifest purge
in this path; retention and safe removal must account for receipt recovery, replica progress and reclamation.

## Installing or resuming the migration

Expand Down
Loading
Loading