LCK_M_RS_U Wait Type in SQL Server

LCK_M_RS_U is a wait to acquire an Update lock on a key together with an Update Range lock on the gap between it and the previous key. It belongs to the serializable range-lock family: SQL Server takes it when a serializable transaction searches a range it intends to update, using update-mode semantics to stay deadlock-friendlier than going straight to exclusive.

As with all LCK_M_R* waits, seeing it at all means serializable isolation is active somewhere.

Is It a Problem?

Treat it as a two-part question. First, is serializable intentional? It frequently arrives uninvited via distributed transactions, ORM defaults, or HOLDLOCK hints, and range locks block a far wider surface than plain key locks. Second, if serializable is deliberate, is the range being locked narrow? An update searching on an unindexed predicate under serializable range-locks everything it scans, which can approach a whole table.

Update-range waits are also the warm-up for range deadlocks: the update lock converts to exclusive at modification time, and conversions under contention are classic deadlock fuel.

Common Causes

  • Serializable UPDATE ... WHERE key BETWEEN ... patterns colliding on overlapping ranges.
  • Unindexed predicates widening the locked range dramatically.
  • Silent serializable promotion (MSDTC, framework defaults, HOLDLOCK).
  • Concurrent batch jobs sweeping adjacent key ranges.

What To Do

  1. Identify the serializable sessions and their statements (sys.dm_exec_sessions isolation level 4, joined to requests).
  2. Index the predicate so the range lock covers a handful of keys instead of a scan’s worth.
  3. Downgrade isolation where the semantics allow; snapshot isolation gives consistency without range locks for many of these patterns.
  4. Partition the key ranges of concurrent batch jobs so they stop overlapping.

How To See It

Rank it against everything else with Get-WaitStatistics, and read the whole LCK_M_R* group plus deadlock history together.


Part of the SQL Server Wait Types Library.
Related deep dive: LCK_M_X, LCK_M_S, and LCK_M_U Wait Types.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *