Skip to content
Snippets Groups Projects

winery: fix write shard locking

Merged Nicolas Dandrimont requested to merge olasd/swh-objstorage:mr/winery-locking into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading