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

ctdb: add ctdb-monitor-nodes command #127

Merged
merged 8 commits into from
Jul 18, 2024

Conversation

phlogistonjohn
Copy link
Collaborator

Add a ctdb-monitor-nodes command - this command will monitor the
cluster meta and update the containers/ctdb when/if it changes.
The --write-nodes parameter is used to instruct the command to
write the ctdb nodes file on changes. The --reload option is used to
control what "nodes" issue ctdb reloadnodes commands: leader (only the
cluster leader), all (all nodes that see the cluster meta change), and never
(never issue reloadnodes commands).

Fix the help text for `--write-nodes`. The previous help text was
incorrect copy-paste.

Signed-off-by: John Mulligan <[email protected]>
Move the limited-retries-on-error logic to a class that can be reused
later.

Signed-off-by: John Mulligan <[email protected]>
Rename a function to manage_cluster_meta_updates to better match what it
does. A future change will want to use the word "monitor" for something
else and it would be confusing to continue calling this a "monitor"
function vs "manage -- and this function is the more active
"participant" of the two.

Signed-off-by: John Mulligan <[email protected]>
Make the doc comment on ctdb_manage_nodes more accurate.

Signed-off-by: John Mulligan <[email protected]>
Split out some logic from the cluster_meta_to_nodes function into
separate functions for current & later reuse.

Signed-off-by: John Mulligan <[email protected]>
@phlogistonjohn phlogistonjohn marked this pull request as ready for review July 15, 2024 18:35
@phlogistonjohn
Copy link
Collaborator Author

Note: this function is "co-evolving" with the ceph branch I have adding experimental ctdb support to smb-on-ceph. I expect this function to keep evolving a bit as the ceph support is improved and refined as well. I'm also hoping that eventually we can move away from writing the nodes file and use a nodes hook script, but that depends on changes in ctdb.

That's one reason that this is a whole new subcommand. The other is that when I looked into combining this with the existing manage node updaetes function it was clear that the features needed there (the k8s samba-operator) is diverging a bit from the feature set we want on ceph, so it seems safer and less regression prone to just make a different function altogether.

Add the monitor_cluster_meta_changes to the ctdb module. This function
monitors the cluster meta and can reflect those changes into the ctdb
nodes file and/or call reload nodes. Unlike the previous
manage_cluster_meta_updates the sambacc process is not an active
participant in the management of the cluster meta rather we assume some
outside entity is updating the metadata with the desired state of the
cluster correctly. monitor_cluster_meta_changes exists to translate
that state into something ctdb can use.

Signed-off-by: John Mulligan <[email protected]>
Add a `ctdb-monitor-nodes` command - this command will monitor the
cluster meta and update the containers/ctdb when/if it changes.
The `--write-nodes` parameter is used to instruct the command to
write the ctdb nodes file on changes. The `--reload` option is used to
control what "nodes" issue `ctdb reloadnodes` commands: leader (only the
cluster leader), all (all nodes that see the cluster meta change), and never
(never issue reloadnodes commands).

Signed-off-by: John Mulligan <[email protected]>
Copy link
Collaborator

@synarete synarete left a comment

Choose a reason for hiding this comment

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

lgtm

@phlogistonjohn
Copy link
Collaborator Author

@anoopcs9 ping

Copy link
Collaborator

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

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

lgtm.

@mergify mergify bot merged commit 61497ce into samba-in-kubernetes:master Jul 18, 2024
9 checks passed
@phlogistonjohn phlogistonjohn deleted the jjm-ctdb-mon branch July 18, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants