sql: subject SELECT FOR UPDATE to sql_safe_updates
#110131
Labels
A-read-committed
Related to the introduction of Read Committed
A-sql-optimizer
SQL logical planning and optimizations.
branch-release-24.1
Used to mark GA and release blockers and technical advisories for 24.1
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
GA-blocker
T-sql-queries
SQL Queries Team
SELECT FOR UPDATE will acquire a lock on each row returned. For serializable isolation transactions, these locks are unreplicated (today). For weak isolation transactions, these locks are replicated and will cause disk writes.
This makes a full-table locking scan fairly dangerous. To avoid cluster instability, we should subject full-table locking scans to
sql_safe_updates
, so that users either need toSET sql_safe_updates = false
or add aWHERE true
predicate to run them.Jira issue: CRDB-31277
The text was updated successfully, but these errors were encountered: