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 some small problems in the live upgrade procedure #385

Merged
merged 4 commits into from
Feb 27, 2023
Merged

Fix some small problems in the live upgrade procedure #385

merged 4 commits into from
Feb 27, 2023

Conversation

mofishzz
Copy link

This is to prepare for the upcoming nydusd live upgrade function.

We observe the following deadlock when live upgrade:

- sc.upgradeDaemons
  - sc.manager.Lock()
    - manager.upgradeNydusDaemon
      - m.mu.Lock()

Let's fix it.

Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com>
By this we can use the new daemon to handle the upcomming mounts.

Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com>
Send states to the new daemon to restore.

Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com>
So we can get the correct state after umount.

Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com>
@codecov-commenter
Copy link

Codecov Report

Base: 27.99% // Head: 28.03% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (c1971c3) compared to base (63c4a14).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
+ Coverage   27.99%   28.03%   +0.03%     
==========================================
  Files          40       40              
  Lines        4086     4081       -5     
==========================================
  Hits         1144     1144              
+ Misses       2803     2798       -5     
  Partials      139      139              
Impacted Files Coverage Δ
pkg/daemon/daemon.go 0.00% <0.00%> (ø)
pkg/manager/daemon_adaptor.go 0.00% <0.00%> (ø)
pkg/manager/manager.go 18.53% <0.00%> (+0.37%) ⬆️
pkg/system/system.go 5.90% <0.00%> (-0.32%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -316,6 +318,11 @@ func (sc *Controller) upgradeNydusDaemon(d *daemon.Daemon, c upgradeRequest) err
return err
}

su := manager.SupervisorSet.GetSupervisor(d.ID())
if err := su.SendStatesTimeout(time.Second * 10); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have to receive the old nydusd's states before a takeover request to new nydusd ?

Copy link
Author

Choose a reason for hiding this comment

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

It's a similar procedure to doDaemonFailover function. The snapshotter needs to send the old nydusd's state to new one when takeover.

Here send refers to from snapshotter to nydus, as opposed to sendfd process, which may be a little confusing.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@changweige changweige 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 the patches. Only a few questions are left. Overall looks good and tidy.

@changweige changweige merged commit 2fc62a6 into containerd:main Feb 27, 2023
@mofishzz mofishzz deleted the hjn/live-upgrade branch February 27, 2023 08:29
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