Skip to content

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Sep 29, 2022

We used 'select for update' to lock a deployment against concurrent writes. It seems that that has bad consequences for performance in general; advisory locks are more lightweight than locking table rows, hopefully using them here will help write performance.

//! * 1, n: to lock copying of the deployment with id n in the destination
//! shard
//! * 2, n: to lock the deployment with id n to make sure only one write
//! happens to it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might help readability to introduce a constant for the 1 and 2.

We used 'select for update' to lock a deployment against concurrent
writes. It seems that that has bad consequences for performance in general;
advisory locks are more lightweight than locking table rows, hopefully
using them here will help write performance.
@lutter lutter merged commit 55f2f08 into master Oct 13, 2022
@lutter lutter deleted the lutter/lock branch October 13, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants