[SERVER-34649] Return a bad status when the MovePrimarySourceManager receives a bad return from commitMovePrimary Created: 24/Apr/18  Updated: 29/Oct/23  Resolved: 26/Apr/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.7.5
Fix Version/s: 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

(function() {
    "use strict";
 
    const dbName = "test";
 
    const st = new ShardingTest({shards: 2});
 
    assert.commandWorked(st.s.getDB("config").getCollection("databases").insert({_id: dbName, partitioned: false, primary: st.shard0.shardName}));
    print("config.databases entry for " + dbName + ": " + tojson(st.s.getDB("config").getCollection("databases").findOne({_id: dbName})));
 
    assert.commandWorked(st.s.adminCommand({ movePrimary: dbName, to: st.shard1.shardName }));
 
    st.stop();
})();

Sprint: Sharding 2018-05-07
Participants:

 Description   

I would expect, from the MovePrimarySourceManager::commitOnConfig() code, that if the commitMovePrimary command against the config server fails, then the donor shard primary will fassert.

But, that doesn't seem to be the case (see repro).

It's a separate issue whether we actually want the donor shard primary to fassert blindly here. We particularly may not want to it to fassert blindly, because a config.databases entry that's missing a database version will cause the commitMovePrimary to fail (which can happen if someone directly inserts into config.databases).

EDIT: It turns out that the fassert does not work. We will just uassert instead.



 Comments   
Comment by Githook User [ 26/Apr/18 ]

Author:

{'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake', 'name': 'Blake Oler'}

Message: SERVER-34649 Return a bad status when the MovePrimarySourceManager receives a bad return from commitMovePrimary
Branch: master
https://github.com/mongodb/mongo/commit/fb9e6ec91f45036266e9678e4806ca5cbb318164

Comment by Blake Oler [ 24/Apr/18 ]

It turns out that the fassert doesn't work at all, due to a bug nobody catched. I will add a uassert to make sure that we don't blindly succeed if a commit fails.

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