I perform several ETL batch operations in parallel in my Redshift cluster.
My pipeline does the following:
Do a bunch of things on a temporary staging table. In the end, go to the final table (constant and shared through the process) by doing:
BEGIN; LOCK table X; DELETE FROM X USING stage_table... INSERT INTO X ... END;
However, when I have several processes in parallel, some fail:
ERROR: 1023 DETAILS: Insulation failure after serialization on the table - 142443, operation> loop formation: 388224, 388226 (pid: 32012)
(where 142443 is table X)
When I start the process one by one, everything works like a charm. I used the lock with success on other processes (and verified that it worked as intended), so I am puzzled here. Any help appreciated!
source share