Skip to content

Commit

Permalink
Add more documentation about the advisory lock ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkaemming committed Dec 8, 2023
1 parent 4d1114c commit 2414894
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin-server/src/worker/ingestion/person-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,12 @@ const deferredPersonOverridesProcessedCounter = new Counter({
})

export class DeferredPersonOverrideWorker {
// The advisory lock identifier/key used to ensure that only one process is
// updating the overrides at a time.
// This lock ID is used as an advisory lock identifier/key for a lock that
// that ensures only one worker is able to update the overrides table at a
// time. (We do this to make it simpler to ensure we maintain the
// consistency of transitive updates.) There isn't any special significance
// to this particular value (other than Postgres requires it to be a numeric
// one), it just needs to be consistent across all processes.
public readonly lockId = 567

private writer: PersonOverrideWriter
Expand Down

0 comments on commit 2414894

Please sign in to comment.