Allow restore to retry connecting to state server
Merge pull request #215 from wallyworld/restore-connection-retry-1.20

Allow restore to retry connecting to state server

The restore process recreates a state server but it may not have finished starting everything before attempting to reconnect. So a retry loop is added where needed. Tested live on EC2, first to reproduce the bug and then to verify the fix.

Fixes: https://bugs.launchpad.net/juju-core/+bug/1336104
Increment juju to 1.20.1
Merge pull request #240 from sinzui/inc-1.20.1

Increment juju to 1.20.1

Increment juju stable 1.20 to 1.20.1.
Specify a smaller mongo oplog size on local provider

Since the local provider has a single Mongo instance,
the oplog is unuseful. We reduce the size to speed up
preallocation.
Reopen mongo sessions between replset initiation attempts
Also, reinstate a change made by mfoord to call
CurrentStatus after attempting intiation, and
refresh session between attempts.

https://bugs.launchpad.net/juju-core/+bug/1339240
Merge pull request #274 from axw/lp1338179-local-oplog-1.20

Specify a smaller mongo oplog size on local provider

Since the local provider has a single Mongo instance,
the oplog is unuseful. We reduce the size to speed up
preallocation.

(Cherry-pick from master)

Fixes https://bugs.launchpad.net/juju-core/+bug/1338179
Merge pull request #276 from axw/lp1339240-mongo-replset-retry-1.20

Reopen mongo sessions between replset initiation attempts

Also, reinstate a change made by mfoord to call CurrentStatus
after attempting intiation, and refresh session between attempts.

(Cherry-pick from master)

Fixes https://bugs.launchpad.net/juju-core/+bug/1339240
cmd/jujud: ensure we don't ensureMongoServer twice

The upgrade-steps and StateWorker both call ensureMongoServer,
which is meant to check/set a flag so that we only set it up
once. There's an early exit case which meant that the flag was
not being set, which led to the upgrade-steps code restarting
mongo half-way through.

Fixes https://bugs.launchpad.net/juju-core/+bug/1338511
Merge pull request #280 from axw/lp1338511-machineagent-ensuremongoserver-already-1.20

cmd/jujud: ensure we don't ensureMongoServer twice

The upgrade-steps and StateWorker both call ensureMongoServer,
which is meant to check/set a flag so that we only set it up
once. There's an early exit case which meant that the flag was
not being set, which led to the upgrade-steps code restarting
mongo half-way through.

(Cherry pick from master)

Fixes https://bugs.launchpad.net/juju-core/+bug/1338511
Increment juju to 1.20.2
Merge pull request #283 from sinzui/inc-1.20.2

Increment juju to 1.20.2

Update juju version and win installer to 1.20.2.
Backport instance harvesting fix from master
Merge pull request #323 from wallyworld/provisioner-destroys-instances-incorrectly-1.20

Backport instance harvesting fix from master

I messed up the backport last time.