Rolling Update - Can it start a new election

Hi teachers and students,

I have a question about Rolling Upgrade after watching the “Setting Up a Sharded Cluster” lesson.

If I have understood the previous lessons, we must be a little bit more careful, don’t we ?

Because, to apply the new configuration, we turn off the node2 (by calling db.shutdownServer()).
And we restart it with mongod -f <conf_file>

Then we do the same with the node3. But when we stopped node2, if we exceed the configured timeout, another election will take place and maybe node3 just becomed a primary.
And in this case we have to manage node 1 (becomed secondary) and finally node3.

Do you agree with this or am I wrong ?

Thanks a lot for your answer :slight_smile:

Hi @Geoffrey_91795,

Yes, you are right.
Node 3 can become the primary here.

Can you please elaborate your question a bit, I didn’t quite understand your doubt.

Curriculum Support Engineer

Thank you @Muskan_47318 for your answer !

I wanted to be sure of it, in case will have to do this one day in production.

My last doubt, which was effectively unclear, was to say that if node3 was becomed a primary, we have to change its configuration in last (rs.stepDown(), db.shutdownServer() and mongod -f <config_file>)

But you have already give it a response :slight_smile:

Thank you a lot, I think it is now clear :slight_smile:

Have a lovely day.

1 Like

@Geoffrey_91795, here’s a good article on Rolling Updates:

1 Like

Thank you @007_jb, really interesting :+1: