From 31f8905f1b77a6071ec8803bff9ab53655ff459f Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Tue, 20 Oct 2026 16:33:13 +0200 Subject: [PATCH] fix (DMS): widen FC_Replicas RepID to BIGINT 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. --- src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql | 4 ++-- .../DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql b/src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql index e6a7a8fbae3..45587f143ee 100755 --- a/src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql +++ b/src/DIRAC/DataManagementSystem/DB/FileCatalogDB.sql @@ -68,7 +68,7 @@ CREATE TABLE FC_Statuses ( -- ----------------------------------------------------------------------------- CREATE TABLE FC_Replicas ( - RepID INT AUTO_INCREMENT PRIMARY KEY, + RepID BIGINT AUTO_INCREMENT PRIMARY KEY, FileID INT NOT NULL, SEID INTEGER NOT NULL, Status SMALLINT UNSIGNED NOT NULL, @@ -81,7 +81,7 @@ CREATE TABLE FC_Replicas ( -- ------------------------------------------------------------------------------ CREATE TABLE FC_ReplicaInfo ( - RepID INTEGER NOT NULL AUTO_INCREMENT, + RepID BIGINT NOT NULL AUTO_INCREMENT, RepType ENUM ('Master','Replica') NOT NULL DEFAULT 'Master', CreationDate DATETIME, ModificationDate DATETIME, diff --git a/src/DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql b/src/DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql index 0c00503540d..0caa6208f47 100755 --- a/src/DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql +++ b/src/DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql @@ -180,7 +180,7 @@ CREATE TABLE FC_Files( -- do we want the delete on cascade on the SE? CREATE TABLE FC_Replicas ( - RepID INT AUTO_INCREMENT, + RepID BIGINT AUTO_INCREMENT, FileID INT NOT NULL, SEID INTEGER NOT NULL, Status INTEGER NOT NULL,