-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add clustering interface #195
Add clustering interface #195
Conversation
Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
This fits better with the naming of the enable and disable functions. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
This more accurately describes its meaning. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
The value of this field can be derived from membership of enabled_members, so there's no need to try to maintain this field. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
This is needed in case of IP address changes while the node was disabled. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
This is needed in the case that all other nodes a node was aware of have changed address. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
The modification to Remote.config adds a 'start' parameter. Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Signed-off-by: Callum McIntyre <callum.mcintyre@citrix.com>
This is private to the implementation of xapi-clusterd Signed-off-by: Edwin Török <edvin.torok@citrix.com>
This should allow to find which XAPI task causes which xapi-clusterd RPC calls, and also to track xapi-clusterd RPC calls across hosts. Signed-off-by: Edwin Török <edvin.torok@citrix.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments.
cluster/cluster_interface.ml
Outdated
[@@deriving rpcty] | ||
|
||
type address = IPv4 of string | ||
[@doc ["An IP address"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this say "An IP address a.b.c.d" or similar to indicate that this is IPv4 and not a hostname or IPv6?
|
||
let create = declare | ||
"create" | ||
["Creates the cluster. The call takes the initial config of"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we concatenate these strings, we get something like ".. of;the ..". Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ;
won't be part of the concatenation, it separates the strings in the ocaml list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. So the concatenation would add a space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it concatenates the strings with spaces: https://github.com/mirage/ocaml-rpc/blob/474d9cd1a10de4f6078a6422e14a91ed84d8173b/lib/markdowngen.ml#L97
IPv6 support is not implemented yet. Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Can this be merged? |
cluster/cluster_interface.ml
Outdated
let xml_path = "/var/xapi/cluster" | ||
|
||
type debug_info = string | ||
[@@doc ["An uninterpreted string associated with the operation."]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference: now you can use actual docstrings here, and they will work as well
cluster/jbuild
Outdated
(modules (:standard)) | ||
(flags (:standard -w -39 %s)) | ||
(libraries (xcp threads rpclib)) | ||
(wrapped false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start wrapping xcp-idl
libraries (this is not an issue or something to do now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the executable rules for cluster_client
and call itcluster_cli
in line with the other components. Do not add a public_name
or an alias. If #198 is merged before this PR, please update the README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll update the PR, you are right we can drop cluster_idl.ml in that case.
Do we want the history to be cleaned up? This is new code - so in my opinion this could be also squashed or we could have one commit per file. |
cluster/jbuild
Outdated
(library | ||
((name xcp_cluster) | ||
(public_name xcp.cluster) | ||
(modules (:standard)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should do completely delete (modules (:standard \ cluster_client))
andcluster_idl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, an oversight. I meant to add a cluster_cli
as with the other components. Then remove that from the modules
list, and add the executable rules
cluster/cluster_client.ml
Outdated
@@ -0,0 +1,14 @@ | |||
|
|||
open Xcp_client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line with comments in new clients, please don't open this globally, but add let open Xcp_client
inside the rpc
function body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the changes to make the structure close to the one of the other components, and before merging let's squash the commits. I think we can do that from github at merge time
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
A more complete CLI is available as part of the clustering daemon itself. Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Pushed some cleanups, I agree that we should squash it all at merge time. |
The failure is the same on as in #198 due to coverage script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, too much renaming. Client should still be called cluster_client.ml
and interface
called cluster_interface.ml
. Then in the code using it we shouold use Cluster_client
and Cluster_interface
. This is what we do on all other idl components. I think this was due to lack of packing of the submodules, but at least the naming makes it clear where the modules are coming from and are consistent across the various interfaces.
Isn't it a bit redundant to have |
It is, but I'd rather keep things consistent and we cannot change all the other interfaces for the moment |
also explain why we call it LocalAPI (because we also have a Remote API elsewhere). Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Ok, wrapping is back and renamed the files to have |
Feel free to merge |
This adds a new
xcp.cluster
library for the new clustering interface and doesn't touch any of the existing interfaces:The spec file doesn't require any changes.
The purpose of this PR is to reduce the diff against master to make merging
feature/REQ477
easier.The commit history here reflects the development, could consider squashing them if preferred.