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

Fix snapshot restoration on fresh nodes #4737

Merged

Conversation

galal-hussein
Copy link
Contributor

Proposed Changes

  • Resetting the api address key in case of cluster restoration
  • Closing the agent ready channel in cluster restoration as well
  • Fixing an issue with unmigrated bootstrap data

Types of Changes

Bugfix

Verification

  • test restoration of etcd snapshot on a fresh new node

Linked Issues

User-Facing Change


Further Comments

@galal-hussein galal-hussein requested a review from a team as a code owner December 13, 2021 22:54
@@ -198,6 +198,11 @@ func (e *ETCD) Reset(ctx context.Context, rebootstrap func() error) error {
t := time.NewTicker(5 * time.Second)
defer t.Stop()
for range t.C {
// resetting the apiaddresses to nil since we are doing a restoration
if _, err := e.client.Put(ctx, AddressKey, ""); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to ask why Put empty string instead of just Delete but i see that our Put is much easier to use since it handles getting the current revision for you...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah exactly :D

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
@galal-hussein galal-hussein merged commit d71b335 into k3s-io:master Dec 14, 2021
briandowns pushed a commit to briandowns/k3s that referenced this pull request Dec 14, 2021
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns pushed a commit to briandowns/k3s that referenced this pull request Dec 14, 2021
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns pushed a commit to briandowns/k3s that referenced this pull request Dec 14, 2021
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
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.

None yet

3 participants