Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54410

[SBE] Tailable cursors are broken when SBE is on and legacy reads are enabled

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Query Execution 2021-03-08

      As a simple repro, start a mongod with SBE enabled:

      ./mongod --setParameter featureFlagSBE=true
      

      Then run the following through the shell:

      db.getMongo().forceReadMode("legacy");
      db.c.drop();
      db.createCollection("c", {capped: true, size: 1024});
      db.c.insert({a: 1});
      db.c.find().tailable();
      

      This query fails spuriously with the following error during the first OP_GET_MORE operation:

      MongoDB Enterprise > db.c.find().tailable();
      Error: error: {
      	"$err" : "OP_GET_MORE operations are not supported on tailable aggregations. Only clients which support the getMore command can be used on tailable aggregations.",
      	"code" : 40548
      }
      

      The reason is that this check assumes that only aggregate cursors use the "locks internally" lock policy. This is no longer true, since find cursors using the SBE engine also use the "locks internally" lock policy.

            Assignee:
            nikita.lapkov@mongodb.com Nikita Lapkov (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: