Skip to content

winery: fix write shard locking

SharedBase would lock a database row in a given transaction for update, but never actually update it (in that transaction), so multiple processes or threads could end up locking the same row (therefore writing to the same shard).

Implement shard locking by recording a uuid for the writer, and the current timestamp at time of locking. Doing both select and update in the same transaction should be properly concurrency-proof.

Merge request reports