Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Oct 7, 2025

Serialize attestation processing and identity update inserts to prevent concurrent attestation from generating multiple envelopes in pkg/payerreport/store.CreateAttestation and pkg/payerreport/workers.AttestationWorker.AttestReports

Introduce a transaction-scoped advisory locking helper and apply row-level locking to coordinate attestation and identity update operations. The changes add db.AdvisoryLocker and db.TransactionScopedAdvisoryLocker, replace sequence-based identity update locks with originator node ID-based locks, lock payer report rows during attestation, and serialize worker execution via a fixed advisory lock.

📍Where to Start

Start with the payerreport.Store.CreateAttestation call path in store.go, then review the advisory locking helper in db.TransactionScopedAdvisoryLocker and db.AdvisoryLocker in advisory_lock.go, followed by queries.FetchPayerReportLocked in payer_reports.sql.go and the worker changes in payerreport.AttestationWorker.AttestReports in attestation.go


Macroscope summarized b54fd81.

@mkysel mkysel requested a review from a team as a code owner October 7, 2025 18:36
@graphite-app
Copy link

graphite-app bot commented Oct 7, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@mkysel mkysel merged commit 1052486 into main Oct 8, 2025
11 checks passed
@mkysel mkysel deleted the mkysel/attestation-locks branch October 8, 2025 14:17
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