subql
subql copied to clipboard
DB write locks
In order to guard against more than one node running for the same project and schema there should be a lock on the tables for the schema to stop this happening.
Requirements:
- Setup write lock on all tables in the schema. Query should look something like this
LOCK TABLE schema_name.* IN ACCESS EXCLUSIVE MODE;
- Don't create write locks if the project is a multichain project
- It should update the locks with any schema migrations
- It should work with POI. This currently has another connection for a sync task.