Skip to content

Prevent ExclusiveLease try_obtain inside db transactions

Sylvester Chin requested to merge sc1-fix-exclusivelease-txn-check into master

What does this MR do and why?

This MR adds a check to prevent ExclusiveLease .try_obtain inside db transactions.

This avoids IO in database transactions which could lead to idle transactions especially if there is a sleep in between lock attempts.

Checking at the lowest level (ExclusiveLease) casts the widest net to avoid violations.

This is corrective action for gitlab-com/gl-infra/production#17504 (comment 1750659403)

Reviews/Approvals tracking

  • backend review by @reprazent
  • backend maintainer approval - @hustewart
  • test review approval - @panoskanell + @hustewart
  • clickhouse approval - @cablett
  • verify approval - @pedropombeiro

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Sylvester Chin

Merge request reports