- Newest
- Most votes
- Most comments
In Redshift, explicitly locking using the lock command is acquired in "ACCESS EXCLUSIVE" mode and is released when the transaction that contains the LOCK command completes.
To determine which transactions might be facing/causing serialization isolation error, you can refer system table STL_TR_CONFLICT , which has information to identify transaction conflicts that result from serializable isolation errors ->https://docs.aws.amazon.com/redshift/latest/dg/r_STL_TR_CONFLICT.html
Based on which , you should get
-> a tablename( by determining the locks using svv_transactions and the associated relation id , which can then be used to determine table name in svv_table_info )
---****
-> https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TRANSACTIONS.html -> https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
-> 2 or more transaction ids (xids) that are involved in the conflict (stl_tr_conflict) and are forming cycles. ---****
Using the above you can determine the sequence of statements executed in those by querying svl_statementtext which led to this error
-> https://docs.aws.amazon.com/redshift/latest/dg/r_SVL_STATEMENTTEXT.html
Moreover, managing transactions inside a stored procedure is a good walk-through of how to layout your code -> https://docs.aws.amazon.com/redshift/latest/dg/stored-procedure-transaction-management.html
Relevant content
- asked a year ago
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago