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

Fix PostgreSQL concurrent update error when adding documents to a collection in bulk

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.10, 2021.0
    • Fix Version/s: None
    • Component/s: Core VCS

      Description

      When adding ~200 documents to a collection using the Bulk Action Framework, a Concurrent update PostgreSQL error can occasionally occur. See the attached log file.

      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "collection_documentids_unique_pos"
        Detail: Key (id, pos)=(541372a5-7b93-4812-81ab-06c0ba340fca, 102) already exists.
      

      To reproduce the issue, extract the attached file in a directory and execute script NXP.sh, which performs the following actions:

      • it creates 200 documents in a new workspace
      • it creates a collection
      • it attaches the 200 documents to the collection
      • it deletes the workspace if requested at the end

      Increase the number of document created if needed by changing the value of variable NBR in script NXP.sh.
      Change variables in file .setenv if your Nuxeo instance is not running on your localhost.

      During my tests, I noticed the error happens more often in LTS 2021 than in LTS 2019.

        Attachments

        1. .setenv
          0.2 kB
        2. bulk_create_documents.sh
          2 kB
        3. NXP.sh
          3 kB
        4. server.log
          31 kB
        5. utils.sh
          1.0 kB
        6. wait_for_bulk_action_completion.sh
          2 kB

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vdutat Vincent Dutat
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: