Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact(upgrade): scale down jiva target deploy before replica patch #1626

Merged
merged 4 commits into from
Mar 11, 2020

Conversation

shubham14bajpai
Copy link
Contributor

Signed-off-by: shubham shubham.bajpai@mayadata.io

What this PR does / why we need it:
This PR adds a step to scale down jiva target deploy before upgrading replica deploy.

Sample logs:

mayadata:upgrade$ k logs -f jiva-vol-170180-pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-b5fjq
I0310 16:41:56.788304       1 jiva_volume.go:80] Started upgrading jivaVolume{pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9} from 1.7.0 to 1.8.0-RC1
I0310 16:41:56.788348       1 jiva_volume.go:87] Upgrading to 1.8.0-RC1
I0310 16:41:57.087781       1 jiva_upgrade.go:424] Scaling down target deploy pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-ctrl in default namespace
I0310 16:42:07.280325       1 helper.go:68] Patching deployment pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-rep
I0310 16:42:32.595875       1 helper.go:95] Deployment pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-rep rolled out successfully
I0310 16:42:32.595892       1 jiva_upgrade.go:205] pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-rep patched
I0310 16:42:32.676854       1 helper.go:68] Patching deployment pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-ctrl
I0310 16:42:47.924426       1 helper.go:95] Deployment pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-ctrl rolled out successfully
I0310 16:42:47.924455       1 jiva_upgrade.go:234] pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-ctrl patched
I0310 16:42:47.940554       1 helper.go:184] targetservice pvc-4c3f661f-4cdc-4244-9916-1983c43c87b9-ctrl-svc patched
I0310 16:42:48.040311       1 jiva_upgrade.go:319] Verifying replica sync
I0310 16:43:05.077518       1 jiva_upgrade.go:351] Synced replica quorum is reached
I0310 16:43:05.077536       1 jiva_upgrade.go:355] Replica syncing complete
I0310 16:43:05.120480       1 jiva_upgrade.go:620] Upgrade Successful forpvc-4c3f661f-4cdc-4244-9916-1983c43c87b9
I0310 16:43:05.229610       1 jiva_volume.go:103] Upgraded successfully

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Checklist:

  • Fixes #
  • Labelled this PR & related issue with documentation tag
  • PR messages has document related information
  • Labelled this PR & related issue with breaking-changes tag
  • PR messages has breaking changes related information
  • Labelled this PR & related issue with requires-upgrade tag
  • PR messages has upgrade related information
  • Commit has unit tests
  • Commit has integration tests

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
}
},
"spec": {
"replicas": 1,
Copy link
Contributor

@akhilerm akhilerm Mar 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[doubt] replicas: 1 Is this where we scale down the target?, setting replica to 1.

It would be better if the indentation changes were excluded, since it is generating a huge diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scale down is performed via update before patching. the replica deployment
This is where scale up the target back again while patching the new image and labels.

Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gave some comments.

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kmova kmova merged commit 4104241 into openebs-archive:master Mar 11, 2020
shubham14bajpai added a commit to shubham14bajpai/maya that referenced this pull request Mar 11, 2020
…penebs-archive#1626)

Avoid the replica's from getting connected to the older version of
the controller and triggering a snapshot delete and so forth code. 

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
kmova pushed a commit that referenced this pull request Mar 11, 2020
…1626)

Avoid the replica's from getting connected to the older version of
the controller and triggering a snapshot delete and so forth code. 

Signed-off-by: shubham <shubham.bajpai@mayadata.io>
@@ -429,6 +469,18 @@ func (j *jivaVolumeOptions) replicaUpgrade(openebsNamespace string) error {
}

statusObj.Phase = utask.StepErrored

err = scaleDownTargetDeploy(j.controllerObj.name, j.ns)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is j.controllerObj be NULL here? it seems to be populated in next step

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if err != nil {
return err
}
pvLabelKey := "openebs.io/persistent-volume"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use existing variables here instead of new ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Will fix this in upcoming PRs.

@shubham14bajpai shubham14bajpai deleted the jiva-upgrade branch March 17, 2020 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants