[SERVER-55672] [SBE][replica_sets] postBatchResumeToken missing after find on oplog Created: 31/Mar/21  Updated: 29/Oct/23  Resolved: 27/Apr/21

Status: Closed
Project: Core Server
Component/s: Query Execution, Replication
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Kyle Suarez Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File resume_after_against_oplog.txt    
Issue Links:
Duplicate
is duplicated by SERVER-55076 [SBE] assert.soon() timeout in jstest... Closed
is duplicated by SERVER-55077 [SBE] assert.soon() timeout in jstest... Closed
is duplicated by SERVER-55078 [SBE] assert.soon() timeout in jstes... Closed
is duplicated by SERVER-55080 [SBE] assert.soon() timeout in jstest... Closed
is duplicated by SERVER-55081 [SBE] assert.soon() timeout in jstest... Closed
is duplicated by SERVER-55083 [SBE] assert.soon() timeout in jstest... Closed
is duplicated by SERVER-55084 [SBE] assert.soon() timeout in jstest... Closed
is duplicated by SERVER-56044 [SBE] Fix various $changeStream tests... Closed
is duplicated by SERVER-56231 [SBE] Certain tests timeout on assert... Closed
Related
related to SERVER-55009 Enable replica_sets suites against SB... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-04-19, Query Execution 2021-05-03
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 27/Apr/21 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-55672 Fix bug in oplog ts logic when 'stopApplyingFilterAfterFirstMatch' is set
Branch: master
https://github.com/mongodb/mongo/commit/3774a333d32ec053145bc9677a0cae3f7bd4522c

Comment by Githook User [ 26/Apr/21 ]

Author:

{'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}

Message: SERVER-55672 Fix oplog timestamp logic in SBE
Branch: master
https://github.com/mongodb/mongo/commit/b5e656c92a92a4d6086a10dad0c1aad6e922fdc3

Generated at Thu Feb 08 05:37:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.