Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Gluster Service check and Remove device node selection #735

Merged
merged 1 commit into from Apr 7, 2017

Conversation

MohamedAshiqrh
Copy link
Member

GetNode will return the node's manage hostname when called for a
clusterID. This hostname is verifed for the glusterd service to be
running.

This enables device remove to verify the node is up or not and then
choose a different node for replace brick command.

Signed-off-by: Mohamed Ashiq Liyazudeen mliyazud@redhat.com

@MohamedAshiqrh
Copy link
Member Author

@lpabon @obnoxxx @heketi/dev PTAL

@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

}
_, err := s.RemoteExecutor.RemoteCommandExecute(host, commands, 10)
if err != nil {
logger.Err(err)
Copy link
Member

Choose a reason for hiding this comment

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

return here

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@MohamedAshiqrh
Copy link
Member Author

@raghavendra-talur Thanks for helping to test the PR and Review. :)

Copy link
Contributor

@obnoxxx obnoxxx left a comment

Choose a reason for hiding this comment

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

aproach looks good in general, but please address the comments. And maybe it should be mentioned in the commit message that due to choosing a node with glusterd running, the actual replacement code is largely simplified by removing the brick killing code.

Please generally improve the commit message: the first line does not really tell me what this patch is doing. a short highlevel description of the achievement should be the first line.

if err != nil {
return err
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

if you don't take any special action upon err != nil, you can just return err here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

if err != nil {
return err
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

just return err?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

}
return nil
})

Copy link
Contributor

Choose a reason for hiding this comment

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

what's happening with err here? no checking?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

}
return nil
})
// Ignore if the node is not online
Copy link
Contributor

Choose a reason for hiding this comment

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

any treatment of err?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -68,6 +69,49 @@ func (n *NodeEntry) registerStorageKey(host string) string {
return "STORAGE" + host
}

// Verify gluster process in the node and return the manage hostname of a node in the cluster
func GetNode(db *bolt.DB, e executors.Executor, clusterId string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a slightly longer and more explanatory function name would be good?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@obnoxxx
Copy link
Contributor

obnoxxx commented Apr 6, 2017

@MohamedAshiqrh additionally, the new GetNodes code would need tests.

@MohamedAshiqrh
Copy link
Member Author

@obnoxxx added tests and changed the name of the function.

GetVerifiedManageHostname will return the node's manage hostname
which is verifed for the glusterd service to be running.

We need not kill the old gluster brick process, hence cleaning up.
This also removed the requirement of using the same node of device
to be removed.

This enables device remove to verify the node is up or not and then
choose a different node for replace brick command.

Signed-off-by: Mohamed Ashiq Liyazudeen <mliyazud@redhat.com>
@obnoxxx
Copy link
Contributor

obnoxxx commented Apr 6, 2017

@centos-ci test

@obnoxxx
Copy link
Contributor

obnoxxx commented Apr 6, 2017

@centos-ci ok to test

and your pickyness about the words is really really irritating! simply "test" should be sufficient imho...

@obnoxxx
Copy link
Contributor

obnoxxx commented Apr 7, 2017

LGTM

@obnoxxx obnoxxx merged commit 4759fdc into heketi:master Apr 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants