Comment 4 for bug 2016868

Revision history for this message
Ian Booth (wallyworld) wrote :

On juju 2.9, I tried to reproduce this and it seemed to work - and rs.confg() and rs.status() confimed it. After enable-ha, I first tested removing machine 1 (a secondary).

Maybe it's an issue introduced in 3.2.

So we had

0: primary
2: secondary, non voting

Then enable-ha created a replacement node

0: primary
2: secondary, voting
3: secondary, voting

Then I removed machine 0, the primary. In this case, the api server does drop (so my debug-log session terminated and my open mongo client connection because invalid). But after a short time (yes, it takes a few seconds), the replicaset was repaired and was configured as expected

2: primary
3: secondary, non voting

Opening a mongo client connection to machine 2:
juju:PRIMARY> rs.config()
{
        "_id" : "juju",
        "version" : 9,
        "term" : 3,
        "protocolVersion" : NumberLong(1),
        "writeConcernMajorityJournalDefault" : true,
        "members" : [
                {
                        "_id" : 3,
                        "host" : "10.240.0.9:37017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 1,
                        "tags" : {
                                "juju-machine-id" : "2"
                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 1
                },
                {
                        "_id" : 4,
                        "host" : "10.240.0.13:37017",
                        "arbiterOnly" : false,
                        "buildIndexes" : true,
                        "hidden" : false,
                        "priority" : 0,
                        "tags" : {
                                "juju-machine-id" : "3"
                        },
                        "slaveDelay" : NumberLong(0),
                        "votes" : 0
                }
        ],
}
juju:PRIMARY> rs.status()
{
        "set" : "juju",
        "date" : ISODate("2023-04-20T01:36:23.784Z"),
        "myState" : 1,
        "term" : NumberLong(3),
        "members" : [
                {
                        "_id" : 3,
                        "name" : "10.240.0.9:37017",
                        "health" : 1,
                        "state" : 1,
                        "stateStr" : "PRIMARY",
                },
                {
                        "_id" : 4,
                        "name" : "10.240.0.13:37017",
                        "health" : 1,
                        "state" : 2,
                        "stateStr" : "SECONDARY",
                }
        ],
        "ok" : 1,
}

And I can use enable-ha to set up the full replicaset again

2: primary
3: secondary, voting
4: secondary, voting

(rs config and status are as expected)