CMS Snapshot Analysis - Compute Snapshot - Fatal Error - deadlock detected

Description

This page will help you with a solution, if your snapshot/consolidation is failing and the below mentioned errors on table, are found in the Cast-MSx.log.txt file.

ERROR: deadlock detected
Détail : Process 24832 waits for AccessExclusiveLock on relation 24088 of database 12002; blocked by process 10660.
Process 10660 waits for AccessShareLock on relation 24099 of database 12002; blocked by process 24832.
Indice : See server log for query details.
Où : SQL statement "truncate table <Table name>"
PL/pgSQL function <function name>(integer) line 9 at SQL statement
org.postgresql.util.PSQLException:ERROR: deadlock detected

As we can see in the logs, a deadlock has been encountered on the database which has forced the snapshot to fail.
A deadlock is created when two applications are each locking the data needed by the other, resulting in a situation when neither application can continue execution.

Observed in CAST AIP

ReleaseYes/No
8.3.x
8.2.x
8.1.x
8.0.x

Observed on RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS3
CSS2

Step by Step Scenario

  1. Package the source code and run the snapshot.
  2. Consult the CAST Dashboard at the same time while a new snapshot/consolidation is being generated involving the same local and central bases.
  3. The snapshot crashes with deadlock error in CAST-ms log file.

Action Plan

This situation may arise if we consult the CAST Dashboard at the same time while a new snapshot is being generated or consolidation of snapshot involving the same local and central bases.
Since some of the central tables are used while using the dashboard and during the generation of the snapshot\consolidation, a deadlock is encountered on the table if both actions are being performed at the same time.
This results in snapshot failure.

The solution would be to

  1. Check with the customer and advise them not to consult the CAST Dashboard while a new snapshot is being generated.

Impact on Analysis Results and Dashboard

Snapshot fails

Notes/comments