-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 9.10-HF41, 10.10-HF17, 11.1, 2021.0
-
Component/s: Directory
-
Tags:
-
Backlog priority:800
-
Sprint:nxFG 11.1.12
If two Nuxeo instances start up concurrently, on PostgreSQL the directory service may fail the table creation:
org.nuxeo.ecm.directory.DirectoryException: Table 'Table(mytable)' creation failed: ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_index" Detail: Key (typname, typnamespace)=(mytable, 2200) already exists. at org.nuxeo.ecm.directory.sql.SQLHelper.createTable(SQLHelper.java:135) ~[nuxeo-platform-directory-sql-10.10-HF06.jar:?] at org.nuxeo.ecm.directory.sql.SQLHelper.setupTable(SQLHelper.java:92) ~[nuxeo-platform-directory-sql-10.10-HF06.jar:?] at org.nuxeo.ecm.directory.sql.SQLDirectory.initialize(SQLDirectory.java:197) ~[nuxeo-platform-directory-sql-10.10-HF06.jar:?] at java.util.ArrayList.forEach(ArrayList.java:1257) ~[?:1.8.0_222] at org.nuxeo.ecm.directory.DirectoryServiceImpl.start(DirectoryServiceImpl.java:83) ~[nuxeo-platform-directory-core-10.10-HF02.jar:?]
We should deal with this by catching the exception, raising ConcurrentUpdateException, and letting the caller in SQLHelper.setupTable just continue in that case.