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

Backup-restore now restart the etcd member incase of etcd's advertise peerURL found to be updated. #788

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

ishan16696
Copy link
Member

@ishan16696 ishan16696 commented Oct 4, 2024

What this PR does / why we need it:

  1. Backup-restore will now call updateMemberPeerURL API call only when peerURL is found to be updated.
  2. Backup-restpre will now restart it's corresponding etcd member after updating etcd's advertise peer URLs if found to be updated.
  3. Introduced a CLI flag --use-etcd-wrapper(default: false) to enable/disable backup-restore to use etcd-wrapper related functionality.

Which issue(s) this PR fixes:
Fixes #787

Special notes for your reviewer:
This PR needs to be tested with PR of etcd-wrapper: gardener/etcd-wrapper#31 where /stop endpoint is introduced with --use-etcd-wrapper set to true for backup-restore.

Release note:

etcd-backup-restore now triggers a restart of the etcd member after updating etcd's advertise peer URLs if found updated.
Introduced a CLI flag `--use-etcd-wrapper` (default: false) to enable/disable the backup-restore to use etcd-wrapper related functionality. Note: enable this flag only if etcd-wrapper is deployed.

@ishan16696 ishan16696 requested a review from a team as a code owner October 4, 2024 12:07
@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Oct 4, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 4, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 4, 2024
@ishan16696 ishan16696 added merge/squash Should be merged via 'Squash and merge' reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 4, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 4, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 7, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 7, 2024
@ishan16696 ishan16696 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 7, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 7, 2024
@unmarshall
Copy link
Contributor

unmarshall commented Oct 7, 2024

@ishan16696 What is the impact of calling etcd-wrapper endpoint from etcdbr on consumers who are only using etcdbr? Let us have this clarity first and then we can remove the reviewed/do-not-merge label.

@unmarshall unmarshall added the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Oct 7, 2024
@ishan16696
Copy link
Member Author

What is the impact of calling etcd-wrapper endpoint from etcdbr on consumers who are only using etcdbr ?

yes, that's very valid point.
I would suggest to introduce a /version endpoint to wrapper just like etcd has version endpoint to detect whether corresponding backup-restore is running with wrapper or not.

curl http://127.0.0.1:2379/version
{"etcdserver":"3.5.9","etcdcluster":"3.5.0"}

backup-restore can send REST request to this URL of wrapper: http://127.0.0.1:9095/version
if response return this {"etcdwrapper":"v0.x."} then only backup-restore calls /stop endpoint in case of detection of peerURL change
else
backup-restore will try to call etcd endpoint http://127.0.0.1:2379/version then just print warning of unable to restart as etcd-wrapper is not found . wdyt ?

@unmarshall
Copy link
Contributor

backup-restore will try to call etcd endpoint http://127.0.0.1:2379/version then just print warning of unable to restart as etcd-wrapper is not found . wdyt ?

I am not sure versioning of HTTP endpoints is the right approach. Instead one should start etcdbr with feature gate which should enable/disable wrapper handling.

@shreyas-s-rao shreyas-s-rao added this to the v0.30.0 milestone Oct 8, 2024
@ishan16696
Copy link
Member Author

ishan16696 commented Oct 8, 2024

Instead one should start etcdbr with feature gate which should enable/disable wrapper handling.

we already have a feature gate in druid as druid deploys etcd and backup-restore with either with etcd-custom-image or etcd-wrapper but IMO, backup-restore should not use feature gate for etcd

@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Oct 8, 2024
@ishan16696
Copy link
Member Author

ishan16696 commented Oct 8, 2024

@unmarshall @shreyas-s-rao and I have decided to introduced the CLI flag: --use-etcd-wrapper to consume etcd-wrapper related functionality in backup-restore with default value of this flag set to false, hence causing no impact on our community users.
We can set --use-etcd-wrapper to true in etcd-druid as it always deploys etcd cluster with etcd-wrapper.

@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 8, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 8, 2024
@ishan16696 ishan16696 removed the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Oct 8, 2024
Copy link
Contributor

@unmarshall unmarshall left a comment

Choose a reason for hiding this comment

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

We have decided to make this backward-incompatible change. This has been added to the compatibility matrix in etcd-druid documentation.
/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review labels Oct 16, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 16, 2024
Copy link
Collaborator

@shreyas-s-rao shreyas-s-rao left a comment

Choose a reason for hiding this comment

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

@ishan16696 thanks for the PR. One small nit from my side, but overall LGTM. I have tested this with gardener/etcd-druid#883 and the upgrade cases work perfectly now.

pkg/miscellaneous/miscellaneous.go Outdated Show resolved Hide resolved
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 16, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 16, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Oct 16, 2024
@ishan16696
Copy link
Member Author

/cla

@gardener-robot
Copy link

@ishan16696 I reached out successfully to the cla-assistant to recheck this pull request.

Copy link
Collaborator

@shreyas-s-rao shreyas-s-rao left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comment.
/lgtm

@unmarshall unmarshall merged commit 8a3bc2c into gardener:master Oct 17, 2024
9 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 17, 2024
@ishan16696 ishan16696 deleted the peerchangedetect branch October 17, 2024 04:07
ishan16696 added a commit to ishan16696/etcd-backup-restore that referenced this pull request Oct 17, 2024
… peerURL found to be updated. (gardener#788)

Fix for comparing member Peer URLs before updating and invoking stop wrapper endpoint
Added a CLI flag:`--use-etcd-wrapper` to server sub-command.

Co-authored-by: madhav bhargava <[email protected]>
Co-authored-by: Shreyas Rao <[email protected]>
ishan16696 added a commit that referenced this pull request Oct 17, 2024
… peerURL found to be updated. (#788) (#794)

Fix for comparing member Peer URLs before updating and invoking stop wrapper endpoint
Added a CLI flag:`--use-etcd-wrapper` to server sub-command.

Co-authored-by: madhav bhargava <[email protected]>
Co-authored-by: Shreyas Rao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge/squash Should be merged via 'Squash and merge' needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
7 participants