Explicit locks in RedShift

lockingredshift

I'm new to AWS Redshift and I wanted to know How i can implement my use-case.

I have a Redshift table which gets lot of Inserts/Selects.
In some cases I need to delete some data from that table. I don't want my Delete to impact other writes and reads.

Can someone suggest what is the best locking mode available in Redshift to implement my use case.

I don't want to end up with dadlocks and some locks hanging in my application.

I tried without locks and I'm observing the following violation:

Serializable isolation violation on table - 156300, transactions forming the cycle are: 6416378, 6416913 (pid:3770);

Also I went through the Redshift cxplicit locks but couldn't find any Official documentation for the same.

I know that Redshift is a wrapper on PostgreSQL, so can I use that documentation for implementing?

Best Answer

Assuming that it works like PostgreSQL in this case:

This is a serialization error that you get because you are using the SERIALIZABLE transaction isolation level.

That is nothing to worry about, just repeat the transaction.