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

Cannot use multi repository (XA mode) with PostgreSQL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 10.10-HF11, 11.1
    • Component/s: Core VCS
    • Release Notes Summary:
      Multi-repository configuration based on XA mode is supported.
    • Tags:
    • Backlog priority:
      900
    • Impact type:
      API change
    • Upgrade notes:
      Hide

      The following APIs are deprecated and will be removed in the future:

      • TransactionHelper.suspendTransaction
      • TransactionHelper.resumeTransaction
      • TransactionHelper.requireNewTransaction

      Instead, the following APIs should be used:

      • TransactionHelper.runInNewTransaction
      • TransactionHelper.runWithoutTransaction
      Show
      The following APIs are deprecated and will be removed in the future: TransactionHelper.suspendTransaction TransactionHelper.resumeTransaction TransactionHelper.requireNewTransaction Instead, the following APIs should be used: TransactionHelper.runInNewTransaction TransactionHelper.runWithoutTransaction
    • Sprint:
      nxFG 11.1.10

      Description

      On 10.10 I have seen some problems using a second repository.

      Steps to reproduce:

      • set up 10.10, register and hotfix it
      • make sure you have a Postgres db host with 'nuxeo' and 'secondrepo' dbs
      • add the following to nuxeo.conf
        nuxeo.templates=postgresql
        nuxeo.db.singleDataSource=
        nuxeo.db.xaMode=true
        
      • drop the attached config files in nxserver/config

      Using docker to quickly set up the postgres db:

      docker pull postgres
      docker run -d -p 5432:5432 --name postgres -e POSTGRES_DB=nuxeo -e POSTGRES_USER=nuxeo -e POSTGRES_PASSWORD=password postgres -c "max_prepared_transactions=100"
      docker exec -it  postgres psql -U nuxeo
      create database secondrepo
      

      Errors like the following are visible in server.log:

      2019-06-04T17:07:02,341 ERROR [Nuxeo-Event-PostCommit-1] [org.apache.geronimo.transaction.manager.RollbackTask] Unexpected exception committing org.apache.geronimo.transaction.manager.WrapperNamedXAResource@6ce6b828; continuing to commit other RMs
      org.postgresql.xa.PGXAException: Error rolling back prepared transaction. rollback xid=[Xid:globalId=11000000047544d4944000000000000000000000000000000000000000000000000000,length=64,branchId=1000000047544d4944000000000000000000000000000000000000000000000000000,length=64], preparedXid=[Xid:globalId=11000000047544d4944000000000000000000000000000000000000000000000000000,length=64,branchId=1000000047544d4944000000000000000000000000000000000000000000000000000,length=64], currentXid={2}
              at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:480) ~[postgresql-42.2.5.jar:42.2.5]
              at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:100) ~[geronimo-transaction-2.2.1.jar:2.2.1]
              at org.apache.geronimo.transaction.manager.RollbackTask.run(RollbackTask.java:63) [geronimo-transaction-2.2.1.jar:2.2.1]
              at org.apache.geronimo.transaction.manager.TransactionImpl.rollbackResources(TransactionImpl.java:584) [geronimo-transaction-2.2.1.jar:2.2.1]
              at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:325) [geronimo-transaction-2.2.1.jar:2.2.1]
              at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) [geronimo-transaction-2.2.1.jar:2.2.1]
              at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:538) [nuxeo-runtime-jtajca-10.10.jar:?]
              at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:363) [nuxeo-runtime-jtajca-10.10.jar:?]
              at org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor$EventBundleRunner.call(PostCommitEventExecutor.java:270) [nuxeo-core-event-10.10-HF06.jar:?]
              at org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor$EventBundleRunner.call(PostCommitEventExecutor.java:210) [nuxeo-core-event-10.10-HF06.jar:?]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
              at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
      Caused by: org.postgresql.util.PSQLException: This connection has been closed.
              at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:783) ~[postgresql-42.2.5.jar:42.2.5]
              at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:727) ~[postgresql-42.2.5.jar:42.2.5]
              at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:454) ~[postgresql-42.2.5.jar:42.2.5]
              ... 13 more
      2019-06-04T17:07:02,347 ERROR [Nuxeo-Event-PostCommit-1] [org.nuxeo.runtime.transaction.TransactionHelper] Unable to commit
      javax.transaction.RollbackException: transaction rolled back due to problems in prepare
              at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:326) ~[geronimo-transaction-2.2.1.jar:2.2.1]
              at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) ~[geronimo-transaction-2.2.1.jar:2.2.1]
              at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:538) ~[nuxeo-runtime-jtajca-10.10.jar:?]
              at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:363) [nuxeo-runtime-jtajca-10.10.jar:?]
              at org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor$EventBundleRunner.call(PostCommitEventExecutor.java:270) [nuxeo-core-event-10.10-HF06.jar:?]
              at org.nuxeo.ecm.core.event.impl.PostCommitEventExecutor$EventBundleRunner.call(PostCommitEventExecutor.java:210) [nuxeo-core-event-10.10-HF06.jar:?]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
              at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.