I’m getting the error Lock wait timeout exceeded; try restarting transaction
while trying to run these five INSERT queries concurrently.
INSERT IGNORE INTO insert_table SELECT * FROM source_table WHERE event_date = '2023-7-30'
INSERT IGNORE INTO insert_table SELECT * FROM source_table WHERE event_date = '2023-7-29'
INSERT IGNORE INTO insert_table SELECT * FROM source_table WHERE event_date = '2023-7-28'
INSERT IGNORE INTO insert_table SELECT * FROM source_table WHERE event_date = '2023-7-27'
INSERT IGNORE INTO insert_table SELECT * FROM source_table WHERE event_date = '2023-7-26'
The result of running these five queries is that only one of them finishes while the other 4 fail and I get the lock wait timeout exception.
I detached the pipeline and I don’t see any other active queries running in the active queries UI in portal.singlestore.com. Each query is trying to insert around 3 million rows. None of the queries have overlapping data with each other. The error occurs both with or without the “IGNORE INTO” clause.
Could I please get some help on understanding why I’m getting this error on just these insert queries? Is this due to a deadlock issue because the queries are locking on a different partition that the other query needs?
Any help is appreciated, thank you.