Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11085

Make cursors consistently return EBUSY when there's a bulk cursor

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 8
    • StorEng - 2023-06-13, 2023-06-27 Lord of the Sprints, 2023-07-11 WiredTractor

      Summary

      Usually, opening a read cursor on an object being bulk loaded would return EBUSY, indicating the object is not accessible._ _It can be the case that opening a bulk cursor and opening a read (or any other) cursor happens concurrently, and the read cursor does not return EBUSY and instead blocks trying to acquire the read lock. This would be because by the time the bulk cursor has set the WT_BTREE_BULK flag, the reader has already performed the check.

      This by itself wouldn't be an issue, but when MongoDB layer locks are involved, we can end up in a deadlock as described in SERVER-77018.

      See this comment with suganthi.mani@mongodb.com's findings for more details.

      Acceptance criteria

      Cursors consistently return EBUSY when conflicting with a bulk cursor, instead of being timing dependant whether an error is returned or the call gets blocked waiting for lock.

      Related tickets
      SERVER-77018

        1. repro_c.txt
          2 kB
        2. repro.txt
          3 kB

            Assignee:
            monica.ng@mongodb.com Monica Ng
            Reporter:
            yujin.kang@mongodb.com Yujin Kang Park
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: