Refactoring of replicaset initiation #2239

Merged
merged 3 commits into from May 11, 2015

Conversation

Projects
None yet
3 participants
Contributor

mjs commented May 7, 2015

cmd/jujud/agent: refactoring replicaset initiation

Instead of deciding whether to do replicaset initiation based on the previous agent version (which can't be relied on in all cases - see the ticket), initiate the replicaset if it hasn't been done yet. This approach is now also taken for other DB upgrade related tasks such as adding the admin user and generating the shared secret.

Also added some basic tests for replicaset initiating as there were none.

Fixes LP #1441913.

worker/peergrouper: avoid unnecessary replicaset initiate attempts

InitiateMongoServer kept trying to initiate the replicaset when it was
already initiated. The retry loop is now exited early if the
replicaset is already up.

This also reduces the peergrouper tests run time from ~2 mins to a few
seconds!

(Review request: http://reviews.vapour.ws/r/1599/)

Contributor

mjs commented May 7, 2015

$$merge$$

Contributor

jujubot commented May 7, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented May 7, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3124

Contributor

mjs commented May 7, 2015

$$apt-get-is-sick$$

Contributor

jujubot commented May 7, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented May 7, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3127

Contributor

mjs commented May 8, 2015

$$one-more-time$$

Contributor

jujubot commented May 8, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented May 8, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3148

Contributor

mjs commented May 8, 2015

$$bad-record-MAC$$

Contributor

jujubot commented May 8, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented May 8, 2015

Build failed: Generating tarball failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3151

Contributor

mjs commented May 8, 2015

$$merge$$

Contributor

jujubot commented May 8, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

mjs added some commits May 5, 2015

cmd/jujud/agent: refactoring replicaset initiation
Instead of deciding whether to do replicaset initiation based on the
previous agent version (which can't be relied on in all cases - see
the ticket), initiate the replicaset if it hasn't been done yet. This
approach is now also taken for other DB upgrade related tasks such as
adding the admin user and generating the shared secret.

Also added some basic tests for replicaset initiating as there were
none.

Fixes LP #1441913.
worker/peergrouper: avoid unnecessary replicaset initiate attempts
InitiateMongoServer kept trying to initiate the replicaset when it was
already initiated. The retry loop is now exited early if the
replicaset is already up.

This also reduces the peergrouper tests run time from ~2 mins to a few
seconds!
Fixed failures in leadership tests due to replicaset initiate changes
1. Patch out replicaset.CurrentConfg
2. Refactored how CurrentConfig and EnsureMongoServer is patched to
   support #1.
3. agentcmd.EnableJournaling replaced with ProductionMongoWriteConcern
   which controls both the J and W MongoDB safe options used by the
   machine agent during tests. It is necessary to turn this off when
   patching out CurrentConfig.
Contributor

mjs commented May 10, 2015

$$alrighty-then$$

Contributor

mjs commented May 10, 2015

$$hello$$

Contributor

mjs commented May 11, 2015

$$merge$$

Owner

wallyworld commented May 11, 2015

Build failed: sad trombone

Owner

wallyworld commented May 11, 2015

$$merge$$

Contributor

jujubot commented May 11, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented May 11, 2015

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3168

Contributor

mjs commented May 11, 2015

$$hmmm$$

Contributor

jujubot commented May 11, 2015

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request May 11, 2015

Merge pull request #2239 from mjs/1441913-replicaset-not-init-1.23
Refactoring of replicaset initiation

**cmd/jujud/agent: refactoring replicaset initiation**

Instead of deciding whether to do replicaset initiation based on the previous agent version (which can't be relied on in all cases - see the ticket), initiate the replicaset if it hasn't been done yet. This approach is now also taken for other DB upgrade related tasks such as adding the admin user and generating the shared secret.

Also added some basic tests for replicaset initiating as there were none.

Fixes LP #1441913.

**worker/peergrouper: avoid unnecessary replicaset initiate attempts**

InitiateMongoServer kept trying to initiate the replicaset when it was
already initiated. The retry loop is now exited early if the
replicaset is already up.

This also reduces the peergrouper tests run time from ~2 mins to a few
seconds!

(Review request: http://reviews.vapour.ws/r/1599/)

@jujubot jujubot merged commit c8c41b0 into juju:1.23 May 11, 2015

@mjs mjs deleted the mjs:1441913-replicaset-not-init-1.23 branch May 11, 2015

cherylj pushed a commit to cherylj/juju that referenced this pull request May 11, 2015

Back out changes from PR #2239
For bug #1453805

These changes were made by backing out the PR
juju#2239
using patch -R.  Local tests completed without
problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment