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

[reconfigurator] Retrieve keeper cluster config information #6606

Merged
merged 6 commits into from
Sep 23, 2024

Conversation

karencfv
Copy link
Contributor

@karencfv karencfv commented Sep 19, 2024

Overview

This commit implements a new clickhouse-admin endpoint to retrieve and parse information from the ClickHouse virtual node /keeper/config which contains the last committed cluster configuration.

Purpose

The main purpose of retrieving this information is to have the ability to populate the inventory's raft_config in ClickhouseKeeperClusterMembership.

pub struct ClickhouseKeeperClusterMembership {
pub queried_keeper: KeeperId,
pub leader_committed_log_index: u64,
pub raft_config: BTreeSet<KeeperId>,
}

In a follow up PR an endpoint that specifically retrieves all information to populate ClickhouseKeeperClusterMembership. This will be done by making several calls to the clickhouse keeper-client and using the parsing function here to populate raft_config.

The endpoint itself will be useful to retrieve information for debugging.

Manual testing

$ curl http://[::1]:8888/keeper/raft-config
{"keeper_servers":[{"server_id":1,"host":{"ipv6":"::1"},"raft_port":21001,"server_type":"participant","priority":1},{"server_id":2,"host":{"ipv6":"::1"},"raft_port":21002,"server_type":"participant","priority":1},{"server_id":3,"host":{"ipv6":"::1"},"raft_port":21003,"server_type":"participant","priority":1}]}

Related: #5999

@karencfv karencfv changed the title [reconfigurator] WIP: Retrieve keeper config information [reconfigurator] Retrieve keeper cluster config information Sep 23, 2024
@karencfv karencfv marked this pull request as ready for review September 23, 2024 02:47
Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

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

Looks great!

let path = parent_dir.join(format!("{prefix}-oximeter-clickward-test"));
std::fs::create_dir(&path)?;

// We use the default ports in `test_schemas_disjoint` and must use a
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We should probably indicate that there are now multiple tests here using clickward and we need to ensure they all use distinct ports.

/// Host of the keeper server
pub host: ClickhouseHost,
/// Keeper server raft port
pub raft_port: u16,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we keep this and other comments to 80 char lines please?

@karencfv karencfv enabled auto-merge (squash) September 23, 2024 21:09
@karencfv karencfv merged commit 48f932f into oxidecomputer:main Sep 23, 2024
17 checks passed
@karencfv karencfv deleted the raft-config branch September 23, 2024 22:32
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.

2 participants