Skip to content

more consistent order for views_lk / schema_lk / bdb lock ordering #5993

Open
dorinhogea wants to merge 1 commit into
bloomberg:mainfrom
dorinhogea:bdbschemaviews
Open

more consistent order for views_lk / schema_lk / bdb lock ordering #5993
dorinhogea wants to merge 1 commit into
bloomberg:mainfrom
dorinhogea:bdbschemaviews

Conversation

@dorinhogea
Copy link
Copy Markdown
Contributor

  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.

…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>
Copy link
Copy Markdown

@roborivers roborivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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**

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