MongoDB: Is it possible add SECONDARY member with version 3.0 to a replica set where members have version 2.6

mongodbupgrade

I have a replica set with 1 secondary and 1 arbiter running version 2.6. and I would like to introduce a new member with version 3.0 so that I can upgrade the whole replica set to 3.0. I wonder if this is a way to to a "rolling upgrade" to MongoDB version 3.0?

The upgrade process I'm thinking would be:

  1. Introduce new member with version 3.0 and let it sync. With priority 0 so that it is not elected at any point.
  2. Once new SECONDARY has caught up, increase priority to make it eligible and remove old SECONDARY server.
  3. Step down PRIMARY (new member with version 3.0 becomes PRIMARY).
  4. Repeat steps 1 and 2 to remove what used to be the original PRIMARY member.

Any other upgrade process suggestions are appreciated.

Thanks

Best Answer

This is basically the rolling upgrade procedure from the docs, with the only difference being that you will temporarily be going up to a 4 member replica set based on what you have described. Hence it's basically a viable strategy if you have concerns about 3.0.

Couple of things I will note:

First, the priority zero step shows good caution but is not really gaining you anything. There is no realistic way for that node to become primary before it catches up (not considered up to date, and if the other two members fail there will not be enough votes to elect it primary with 2 out of 4). There's no harm in doing it, it just doesn't add much in a 4 member set.

The other thing that I will note is that the addition of a new set member is not actually needed. You can stop your current secondary and simply update its binaries to 3.0, restart it and it is good. Do the same for the arbiter, then step down the primary and repeat. No resync is then necessary because 3.0 is fine as a straight drop-in replacement for 2.6.