[SERVER-34976] clear the "needing size adjustment" set at the beginning of replication rollback Created: 14/May/18  Updated: 29/Oct/23  Resolved: 12/Jun/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.0.0-rc6, 4.1.1

Type: Bug Priority: Major - P3
Reporter: Judah Schvimer Assignee: Judah Schvimer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-34977 subtract capped deletes from fastcoun... Closed
related to SERVER-35435 Renaming during replication recovery ... Closed
related to SERVER-42312 Validate during rollback can cause co... Closed
related to SERVER-35052 Turn off fastcount checks on capped c... Closed
is related to SERVER-33488 WT SizeStorer dislikes RTT Closed
is related to SERVER-33863 Add transactions and ddl operations o... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Repl 2018-06-04, Repl 2018-06-18
Participants:
Linked BF Score: 65

 Description   

One problem we've noted is that this call to mark collections as needing size adjustment is not gated on being in storage recovery, which is what it's meant for. This means any collections that are created are marked as needing size adjustment, even if later writes would ensure they have a non-zero size at the stable timestamp when we enter rollback. To fix this, we can clear the "needing size adjustment" set at the beginning of replication rollback.



 Comments   
Comment by Githook User [ 12/Jun/18 ]

Author:

{'username': 'judahschvimer', 'name': 'Judah Schvimer', 'email': 'judah@mongodb.com'}

Message: SERVER-34977 SERVER-35435 SERVER-34976 Fix fastcounts for RTT, including capped collections.

(cherry picked from commit 8b698cac2d19f0fec502db10501e7059a10d2897)
Branch: v4.0
https://github.com/mongodb/mongo/commit/0fd5d4eb2e61bbef14f6e55c8e5f9619e807260b

Comment by Githook User [ 12/Jun/18 ]

Author:

{'username': 'judahschvimer', 'name': 'Judah Schvimer', 'email': 'judah@mongodb.com'}

Message: SERVER-34977 SERVER-35435 SERVER-34976 Fix fastcounts for RTT, including capped collections.
Branch: master
https://github.com/mongodb/mongo/commit/8b698cac2d19f0fec502db10501e7059a10d2897

Comment by Siyuan Zhou [ 01/Jun/18 ]

Fast count is disabled on master and 4.0 in SERVER-33863. After this work, we need to revert those changes to enable fast count checking.

Comment by Judah Schvimer [ 18/May/18 ]

This is a problem even without capped collections. Repro:

(function() {
    'use strict';
 
    load("jstests/replsets/libs/rollback_test.js");
 
    const dbName = "count_rollback";
    const collName = "coll";
    const doc1 = {x: 1};
    const doc2 = {x: 2};
 
    const replSet = new ReplSetTest({name: dbName, nodes: 3, useBridge: true});
    replSet.startSet();
 
    const nodes = replSet.nodeList();
    replSet.initiate({
        _id: dbName,
        members: [
            {_id: 0, host: nodes[0]},
            {_id: 1, host: nodes[1]},
            {_id: 2, host: nodes[2], arbiterOnly: true}
        ]
    });
 
    // Set up Rollback Test.
    const rollbackTest = new RollbackTest(dbName, replSet);
    const primary = rollbackTest.getPrimary();
    const coll = primary.getDB(dbName).getCollection(collName);
    primary.setLogLevel(2, "storage.recovery");
 
    assert.commandWorked(coll.insert(doc1));
    replSet.awaitLastOpCommitted();
 
    assert.commandWorked(
        primary.adminCommand({configureFailPoint: "disableSnapshotting", mode: "alwaysOn"}));
    assert.commandWorked(coll.insert(doc2));
 
    rollbackTest.transitionToRollbackOperations();
    rollbackTest.transitionToSyncSourceOperationsBeforeRollback();
    rollbackTest.transitionToSyncSourceOperationsDuringRollback();
    rollbackTest.transitionToSteadyStateOperations();
    rollbackTest.stop();
 
}());

Generated at Thu Feb 08 04:38:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.