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

Fix concurrent access to deleted complex property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.4-SNAPSHOT
    • Fix Version/s: 7.4
    • Component/s: Elasticsearch

      Description

      Some INSERTs happen during ES indexing and cause conflicts (due to a deleted parent) but these jobs should actually be read-only.

      The root cause is that when we don't find a complex property we create it on the fly, which should not be necessary as it was already created during document creation. If that happens on read, we should just return null. If that happens on write, we should create the complex property (in most code paths it's always previously created, except 1. if it was concurrently deleted or 2. there was a schema change and it's now required).

      The issue was found on the following jobs :

      https://qa.nuxeo.org/jenkins/job/FT-nuxeo-master-cmis-cap-tomcat-multidb-linux/Slave=MULTIDB_LINUX,dbprofile=mssql,jdk=java-8-oracle/106/

      https://qa.nuxeo.org/jenkins/job/FT-nuxeo-master-cmis-cap-tomcat-multidb-linux/Slave=MULTIDB_LINUX,dbprofile=oracle12c,jdk=java-8-oracle/106/

      Caused by: org.nuxeo.ecm.core.storage.ConcurrentUpdateStorageException: java.sql.BatchUpdateException: The INSERT statement conflicted with the FOREIGN KEY SAME TABLE constraint "hierarchy_parentid_hierarchy_fk". The conflict occurred in database "dbjabba4", table "dbo.hierarchy", column 'id'.
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection.checkConcurrentUpdate(JDBCConnection.java:298)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.insertSimpleRows(JDBCRowMapper.java:579)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.writeCreates(JDBCRowMapper.java:481)
      	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.write(JDBCRowMapper.java:451)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: