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

[SPVR-122] Node should be up instead of down after restarting eru-agent for node #497

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

DuodenumL
Copy link
Contributor

在SetNode的时候,如果node.available == false,就把node status给删掉。

在这个PR之前,agent在crash的时候会调用SetNode来把当前node设置为available: false,但是没有删除node status。如果在node status过期之前,agent重启成功,那么node status就会一直是alive: true,并且selfmon无法从NodeStatusStream里监听到任何变化,导致这个node一直是available: false

@jschwinger233
Copy link
Member

如果只是想删除 node status, 那规定 SetNodeStatus(ctx, node, ttl) 的 ttl<0 的语义是删除就可以了?

err := c.store.SetNodeStatus(ctx, node, -1)
if err != nil {
// don't return here
log.Errorf(ctx, "[SetNode] failed to set node status, err: %v", err)
Copy link
Member

Choose a reason for hiding this comment

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

"%+v", errors.WithStack(err)

// this is heartbeat of node
func (m *Mercury) SetNodeStatus(ctx context.Context, node *types.Node, ttl int64) error {
if ttl <= 0 {
if ttl == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

还是记录一下, 虽然不知道为啥 ttl=0 就报错, 隔壁 workload status ttl=0 是不过期, 不过先这样吧, 反正没这需求...

@CMGS CMGS merged commit 88f1805 into projecteru2:master Oct 27, 2021
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.

3 participants