1

I am upgrading mongo version 2.4 to 2.6 I was able to upgrade my complete cluster except one primary member of my replica set during this period my auto running script created a sharded db.

I can not delete this db as it has important data. I wanted to confirm that i can still continue with the upgrade process for last remaining server will it create an issue. I have completed upgrade of all mongos and config server before this.

Please let me know the impact if it will be there.

1
  • You have forgot to upgrade one member or the entire replica-set?
    – Antonios
    Sep 3, 2014 at 13:00

1 Answer 1

1

If all the other components are upgraded, then there will be no impact to the sharded database caused by upgrading the remaining primary. The important pieces for the sharded database/collection are mongos and the config servers rather than the individual members in this case, and you have already done that piece.

If you want to be particularly careful, you can leave the primary on 2.4, step it down and allow a 2.6 secondary to step up to primary (this would be the recommended process anyway, you should always step down a primary to secondary before you upgrade it). Doing it this way also means you have a very simple way to roll back the upgrade if necessary. Once you verify no issues, upgrade the old priamry (now secondary) and you are done.

One caveat - stepping down a primary will force close all active connections (mongos, config servers mainly) to that primary, and they will re-establish connections to the new primary once it is elected. This is expected (and necessary in fact) behavior, but can cause a brief spate of errors (for example for a long running query from that shard, which would error).

4
  • Thanks @Adam C . I have one more query i stopped the balance r while upgrade. can i restart it again and do the update later for this particular member. Sep 4, 2014 at 4:42
  • Yes, though I would recommend stepping the 2.4 node down to secondary first, then turning on the balancer. The primaries do all the real work for migrations (coordinated by the balancer), so stepping one down while the balancer is active can cause aborted migrations and orphaned documents. Neither of those things is a huge problem (in fact you probably won't notice) but I would generally avoid them if possible.
    – Adam C
    Sep 4, 2014 at 9:41
  • ,i cannot step down my 2.4 node to secondary because secondary is still sinking from primary as it has gb's of data.Also, referred from mongodb docs. docs.mongodb.org/manual/release-notes/2.6-upgrade/… it is saying, don't create db or shard any db | collection while upgrade, so please suggest what approach should be taken as tommorrow db is very impportant we cant afford to wait and skip to create next day db. Sep 4, 2014 at 9:53
  • It's not advised to run mixed major versions for an extended period at all - creating a sharded DB might work, but you may also hit unexpected problems. The secondaries not being up to date makes the entire thing more risky - that would be my first priority - getting a secondary up to date, then proceed as advised. Secondaries should not take so long to catch up, even with large data sets - sounds like that set might be struggling in general, though that is beyond the scope of these comments really
    – Adam C
    Sep 4, 2014 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.