rbeckman-nextgen / test-mc3

0 stars 0 forks source link

Failed to Prune on two NG Connect instances with shared database #4333

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

Per client, they are receiving Failed To Prune errors on their AWS deployed instances of Mirth. The configuration is 2 stand-alone Mirth servers sharing a single database. They were unable to implement using clustering. The text of the error is: [2019-12-17 06:37:36,767] ERROR (com.mirth.connect.plugins.datapruner.DataPruner:484): Failed to prune messages for channel Kareo UpdatePatient Channel_-165_5 (2909225c-712a-44cb-8712-46e4ee289a0e). Attempts remaining: 3. org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: deadlock detected Detail: Process 3827 waits for ShareLock on transaction 346798296; blocked by process 30276.Process 30276 waits for ShareLock on transaction 346798299; blocked by process 3827. Hint: See server log for query details. Where: while deleting tuple (16427,14) in relation "d_mc6"### The error may involve Message.pruneMessageContent-Inline### The error occurred while setting parameters### SQL: DELETE FROM D_MC6 M WHERE MESSAGE_ID <= ? AND MESSAGE_ID >= ?### Cause: org.postgresql.util.PSQLException: ERROR: deadlock detected Detail: Process 3827 waits for ShareLock on transaction 346798296; blocked by process 30276.Process 30276 waits for ShareLock on transaction 346798299; blocked by process 3827. Hint: See server log for query details. Where: while deleting tuple (16427,14) in relation "d_mc6" at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147) at org.apache.ibatis.session.defaults.DefaultSqlSession.delete(DefaultSqlSession.java:158) at com.mirth.connect.plugins.datapruner.DataPruner.runDelete(DataPruner.java:704) at com.mirth.connect.plugins.datapruner.DataPruner.runDeleteQueries(DataPruner.java:684) at com.mirth.connect.plugins.datapruner.DataPruner.pruneChannelByIds(DataPruner.java:663) at com.mirth.connect.plugins.datapruner.DataPruner.pruneChannel(DataPruner.java:472) at com.mirth.connect.plugins.datapruner.DataPruner.run(DataPruner.java:336) at java.lang.Thread.run(Thread.java:748)Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected Detail: Process 3827 waits for ShareLock on transaction 346798296; blocked by process 30276.Process 30276 waits for ShareLock on transaction 346798299; blocked by process 3827. Hint: See server log for query details. Where: while deleting tuple (16427,14) in relation "d_mc6" at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:168) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:157) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145) ... 7 more

Imported Issue. Original Details: Jira Issue Key: MIRTH-4478 Reporter: han Created: 2020-01-07T10:26:51.000-0800