Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28231

Allow concurrent startup of SQL Directory

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h