Skip to content

fix(inventory): B2: take a lease without waiting on the group's other writers - #572

Merged
dannash100 merged 1 commit into
mainfrom
fix/b2/lease-lock
Sep 17, 2026
Merged

dannash100 merged 1 commit into
mainfrom
fix/b2/lease-lock

Conversation

@dannash100

Copy link
Copy Markdown
Contributor

take_lease ran 1s to 60s+ in prod while the read endpoints stayed at 0.3s, past the plugin's 15s timeout, so runs fell back to a cache holding no secret values.

  • InventoryLease::take locked the group row FOR UPDATE, which conflicts with the FOR KEY SHARE Postgres holds there for every child-row write; ~25 tables reference server_groups.
  • FOR NO KEY UPDATE instead: FK writes stop blocking it, two concurrent takes still queue.
  • Mechanism and fix are proven; that this is what prod waited on is not, and prod hasn't been re-measured.

🦸 Review Hero

  • Run Review Hero

@dannash100
dannash100 added this pull request to the merge queue Sep 17, 2026
Merged via the queue into main with commit 11d97de Sep 17, 2026
16 checks passed
@dannash100
dannash100 deleted the fix/b2/lease-lock branch September 17, 2026 21:35
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.

2 participants