more consistent order for views_lk / schema_lk / bdb lock ordering #5993
Open
dorinhogea wants to merge 1 commit into
Open
more consistent order for views_lk / schema_lk / bdb lock ordering #5993dorinhogea wants to merge 1 commit into
dorinhogea wants to merge 1 commit into
Conversation
…K ordering in time partition paths. 1. views_cron_restart (db/views.c): BDB_READLOCK was acquired AFTER views_lk, inverting the order of tpt rollout code. While a deadlock is not possible, it is cleaner and more consistent. 2. _view_cron_phase2 (db/views.c): BDB_READLOCK was acquired mid-function after both schema_lk and views_lk were already held. 3. toblock.c: views_lk(rd) is acquired before schema_lk(wr) is taken deep inside bplog_schemachange_run(); we block any transaction that contains both a tpt bptran and another ddl; this prevents a deadlock from happening; fixing the order requires more complicated refactoring. Signed-off-by: dhogea <dhogea@bloomberg.net>
roborivers
approved these changes
May 30, 2026
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Success ✓.
Regression testing: Success ✓.
The first 10 failing tests are:
logfill [db unavailable at finish] **quarantined**
sc_resume_logicalsc_generated **quarantined**
sp_snapshot_generated
consumer_non_atomic_default_consumer_generated **quarantined**
remotecreate_twopc_generated
remotecreate
sc_downgrade [timeout] **quarantined**
truncatesc_offline_generated [timeout] **quarantined**
reco-ddlk-sql [timeout] **quarantined**
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
views_cron_restart (db/views.c): BDB_READLOCK was acquired AFTER views_lk, inverting the order of tpt rollout code. While a deadlock is not possible, it is cleaner and more consistent.
_view_cron_phase2 (db/views.c): BDB_READLOCK was acquired mid-function after both schema_lk and views_lk were already held.
toblock.c: views_lk(rd) is acquired before schema_lk(wr) is taken deep inside bplog_schemachange_run(); we block any transaction that contains both a tpt bptran and another ddl; this prevents a deadlock from happening; fixing the order requires more complicated refactoring.