Repository navigation
Conversation
FC_Replicas.RepID was a signed INT, which can be exhausted on large catalogs because AUTO_INCREMENT values are never reused (also on failed or duplicate inserts). Widen RepID to BIGINT in FileCatalogDB and FileCatalogWithFkAndPsDB, and keep FC_ReplicaInfo.RepID consistent.
This branch has not been deployed
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.
BEGINRELEASENOTES
*DMS
CHANGE: FileCatalogDB - FC_Replicas.RepID and FC_ReplicaInfo.RepID widened to BIGINT to avoid AUTO_INCREMENT exhaustion
*deployment
ENDRELEASENOTES
Summary
FC_Replicas.RepIDwas a signedINT(max 2147483647). InnoDBAUTO_INCREMENTvalues are never reused - not afterDELETE, rollback, or failed/duplicate inserts - and the DFC churns them heavily (re-registrations attempting inserts that fail on theUNIQUE (FileID,SEID)key, replica migrations), so the counter runs ahead of the live row count until inserts start failing on large catalogs.The same change is applied to the reference schema in
FileCatalogWithFkAndPsDB.sql.Evidence
Exercised on a production instance (dbod-dfc, FileCatalogDB):
ALGORITHM=COPYis mandatory: data-type changes are not eligible forINPLACE/INSTANT, so this rebuilds the table and blocks concurrent DML for its duration. On very largeFC_Replicastables,pt-online-schema-change/gh-ostcan be used instead.FC_ReplicaInfo.RepIDstores the same IDs and must be widened too, otherwise it will start failing once RepID crosses 2^31.Merge Danger
Door: two-way
Reverting the code change is trivial. Widening
INTtoBIGINTon live databases is not reversible without another table rebuild, but it is strictly safe: no values are lost, and existingINT-typed consumers ofRepIDreceive a wider type transparently.Blast Radius: FileCatalogDB schema