Move schema lock assertion out of schema lock macro

XMLWordPrintableJSON

    • Storage Engines - Foundations
    • 207.965
    • None
    • None

      BF-44381 was caused by hitting the following assertion when a statistics cursor tried to open a dhandle during a step-up.

      [js_test:failover_without_global_lock] d21097| 2026-07-01T01:51:27.002+00:00 E  WT       22435       [ftdc] "WiredTiger error message","attr":{"error":0,"message":{"ts_sec":1782870687,"ts_usec":2090,"thread":"87164:0xffff63ad2e00","session_dhandle_name":"file:collection-077f13ae-3270-4ebd-b48a-51c541f45013.wt_stable","session_name":"WT_SESSION.open_cursor","category":"WT_VERB_DEFAULT","log_id":1000000,"category_id":12,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"__wt_session_get_dhandle:989:WiredTiger assertion failed: '!(__wt_atomic_load_uint32_relaxed(&((((WT_CONNECTION_IMPL *)((WT_SESSION_IMPL *)(session))->iface.connection))->flags_atomic)) & (uint32_t)(0x10000u | 0x08000u)) || ((((session)->flags) & (0x00010000u)) != 0)'. schema lock acquired during role transition"}}
      [js_test:failover_without_global_lock] d21097| 2026-07-01T01:51:27.002+00:00 E  WT       22435       [ftdc] "WiredTiger error message","attr":{"error":0,"message":{"ts_sec":1782870687,"ts_usec":2154,"thread":"87164:0xffff63ad2e00","session_dhandle_name":"file:collection-077f13ae-3270-4ebd-b48a-51c541f45013.wt_stable","session_name":"WT_SESSION.open_cursor","category":"WT_VERB_DEFAULT","log_id":1000000,"category_id":12,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"__wt_abort:29:aborting WiredTiger library"}}
      [js_test:failover_without_global_lock] d21097| 2026-07-01T01:51:27.002+00:00 F  CONTROL  6384300     [ftdc] "Writing fatal message","attr":{"message":"Got signal: 6 (Aborted).\n"} 

      The assertion firing inside every WT_WITH_SCHEMA_LOCK call is too strict, as there are examples such as the above case where wt_session_get_dhandle temporarily takes a schema lock to open a fresh dhandle, which is readonly and should be allowed.

      This ticket is to separate the fatal assertion from the WT_WITH_SCHEMA_LOCK macro, and call it independently at each of the real schema op entry points so that only real schema ops are prohibited.

            Assignee:
            Alexander Pullen
            Reporter:
            Alexander Pullen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: