Browse Source

YARN-9528. Federation RMs starting up at the same time can give duplicate application IDs. Contributed by Young Chen.

Giovanni Matteo Fumarola 6 years ago
parent
commit
d331a2a0c2

+ 1 - 0
hadoop-yarn-project/hadoop-yarn/bin/FederationStateStore/MySQL/FederationStateStoreTables.sql

@@ -37,6 +37,7 @@ CREATE TABLE membership(
    lastStartTime bigint NULL,
    capability varchar(6000),
    CONSTRAINT pk_subClusterId PRIMARY KEY (subClusterId)
+   UNIQUE(lastStartTime)
 );
 
 CREATE TABLE policies(

+ 4 - 0
hadoop-yarn-project/hadoop-yarn/bin/FederationStateStore/SQLServer/FederationStateStoreTables.sql

@@ -78,6 +78,10 @@ IF NOT EXISTS ( SELECT * FROM [FederationStateStore].sys.tables
             (
                 [subClusterId]
             )
+            CONSTRAINT [uc_lastStartTime] UNIQUE
+            (
+                [lastStartTime]
+            )
         )
 
         SET ANSI_PADDING OFF