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

[SBE][replica_sets] postBatchResumeToken missing after find on oplog

    • Fully Compatible
    • Query Execution 2021-04-19, Query Execution 2021-05-03

      The test runs a find on the oplog collection and then asserts that we get the correct resume token format.

      jsTestLog("Running initial query on the oplog");                                                                                                                                                                                                                              
      {
          const res = assert.commandWorked(localDb.runCommand({
              find: "oplog.rs",
              filter: {op: "i", "o.ans": 42},
              hint: {$natural: 1}, 
              batchSize: 1,
              $_requestResumeToken: true
          }));
      
          assert.eq(res.cursor.firstBatch.length, 1, res);
          assert.eq(res.cursor.firstBatch[0].o._id, 0, res);
      
          // Assert resume token is non-null.
          const resumeToken1 = assertExpectedResumeTokenFormat(res); // <-- fails
      

      The last line fails because the postBatchResumeToken field is missing.

      [js_test:resume_after_against_oplog] uncaught exception: Error: Not all of the values from [ "postBatchResumeToken" ] were in {
      [js_test:resume_after_against_oplog]    "firstBatch" : [
      [js_test:resume_after_against_oplog]            {
      [js_test:resume_after_against_oplog]                    "op" : "i",
      [js_test:resume_after_against_oplog]                    "ns" : "test.resume_after_against_oplog",
      [js_test:resume_after_against_oplog]                    "ui" : UUID("5efe291d-440f-4726-bd19-328987fca64b"),
      [js_test:resume_after_against_oplog]                    "o" : {
      [js_test:resume_after_against_oplog]                            "_id" : 0,
      [js_test:resume_after_against_oplog]                            "ans" : 42
      [js_test:resume_after_against_oplog]                    },
      [js_test:resume_after_against_oplog]                    "ts" : Timestamp(1617146515, 17),
      [js_test:resume_after_against_oplog]                    "t" : NumberLong(1),
      [js_test:resume_after_against_oplog]                    "wall" : ISODate("2021-03-30T23:21:55.763Z"),
      [js_test:resume_after_against_oplog]                    "v" : NumberLong(2)
      [js_test:resume_after_against_oplog]            }
      [js_test:resume_after_against_oplog]    ],
      [js_test:resume_after_against_oplog]    "id" : NumberLong("895888238858507122"),
      [js_test:resume_after_against_oplog]    "ns" : "local.oplog.rs"
      [js_test:resume_after_against_oplog] } :
      [js_test:resume_after_against_oplog] doassert@src/mongo/shell/assert.js:20:14
      [js_test:resume_after_against_oplog] assert.hasFields@src/mongo/shell/assert.js:286:13
      [js_test:resume_after_against_oplog] assertExpectedResumeTokenFormat@jstests/replsets/resume_after_against_oplog.js:32:5
      [js_test:resume_after_against_oplog] @jstests/replsets/resume_after_against_oplog.js:54:26
      [js_test:resume_after_against_oplog] @jstests/replsets/resume_after_against_oplog.js:8:2
      [js_test:resume_after_against_oplog] failed to load: jstests/replsets/resume_after_against_oplog.js
      [js_test:resume_after_against_oplog] exiting with code -3
      

            Assignee:
            arun.banala@mongodb.com Arun Banala
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: