ExportXMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      replset [primary] local> db.aggregate([{$documents:[{}]}], {readConcern:{level:"linearizable"}})
      [ {} ]
      replset [primary] local> db.oplog.rs.find().sort({$natural:-1}).limit(1)
      [
        {
          op: 'n',
          ns: '',
          o: { msg: 'linearizable read' },
          ts: Timestamp({ t: 1779302197, i: 1 }),
          t: Long('1'),
          v: Long('2'),
          wall: ISODate('2026-05-20T18:36:37.615Z')
        }
      ]
      

      There’s no reason for this aggregation to do a linearizable read. The server might as well just skip the oplog write in this case.

      Because of how drivers generally work, such aggregations can be sent without the user realizing that they’re doing a linearizable read for no benefit.

            Assignee:
            Unassigned
            Reporter:
            Felipe Gasper
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: