Skip to content

Commit 9f51dcb

Browse files
authored
Upgrade clickhouse from v22.8.9.24 to v23.8.7.24 (#5127)
1 parent 77669cd commit 9f51dcb

File tree

10 files changed

+122
-73
lines changed

10 files changed

+122
-73
lines changed

oximeter/db/src/client.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ use tokio::fs;
5050
use tokio::sync::Mutex;
5151
use uuid::Uuid;
5252

53+
const CLICKHOUSE_DB_MISSING: &'static str = "Database oximeter does not exist";
54+
const CLICKHOUSE_DB_VERSION_MISSING: &'static str =
55+
"Table oximeter.version does not exist";
56+
5357
#[usdt::provider(provider = "clickhouse_client")]
5458
mod probes {
5559
fn query__start(_: &usdt::UniqueId, sql: &str) {}
@@ -856,10 +860,10 @@ impl Client {
856860
})?,
857861
Err(Error::Database(err))
858862
// Case 1: The database has not been created.
859-
if err.contains("Database oximeter doesn't exist") ||
863+
if err.contains(CLICKHOUSE_DB_MISSING) ||
860864
// Case 2: The database has been created, but it's old (exists
861865
// prior to the version table).
862-
err.contains("Table oximeter.version doesn't exist") =>
866+
err.contains(CLICKHOUSE_DB_VERSION_MISSING) =>
863867
{
864868
warn!(self.log, "oximeter database does not exist, or is out-of-date");
865869
0

oximeter/db/src/configs/keeper_config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</logger>
1010

1111
<!-- To allow all use :: -->
12-
<listen_host from_env="CH_LISTEN_ADDR"/>
12+
<listen_host from_env="CH_LISTEN_ADDR"/>
1313
<path replace="true" from_env="CH_DATASTORE"/>
1414

1515
<keeper_server>

smf/clickhouse_keeper/keeper_config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</logger>
1010

1111
<!-- To allow all use :: -->
12-
<listen_host from_env="CH_LISTEN_ADDR"/>
12+
<listen_host from_env="CH_LISTEN_ADDR"/>
1313
<path replace="true" from_env="CH_DATASTORE"/>
1414

1515
<keeper_server>

smf/clickhouse_keeper/method_script.sh

+16-14
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,22 @@ KEEPER_HOST_01="${keepers[0]}"
3939
KEEPER_HOST_02="${keepers[1]}"
4040
KEEPER_HOST_03="${keepers[2]}"
4141

42-
# Generate unique reproduceable number IDs by removing letters from KEEPER_IDENTIFIER_*
43-
# Keeper IDs must be numbers, and they cannot be reused (i.e. when a keeper node is
44-
# unrecoverable the ID must be changed to something new).
45-
# By trimming the hosts we can make sure all keepers will always be up to date when
46-
# a new keeper is spun up. Clickhouse does not allow very large numbers, so we will
47-
# be reducing to 7 characters. This should be enough entropy given the small amount
48-
# of keepers we have.
42+
# Generate unique reproduceable number IDs by removing letters from
43+
# KEEPER_IDENTIFIER_* Keeper IDs must be numbers, and they cannot be reused
44+
# (i.e. when a keeper node is unrecoverable the ID must be changed to something
45+
# new). By trimming the hosts we can make sure all keepers will always be up to
46+
# date when a new keeper is spun up. Clickhouse does not allow very large
47+
# numbers, so we will be reducing to 7 characters. This should be enough
48+
# entropy given the small amount of keepers we have.
4949
KEEPER_ID_01="$( echo "${KEEPER_HOST_01}" | tr -dc [:digit:] | cut -c1-7)"
5050
KEEPER_ID_02="$( echo "${KEEPER_HOST_02}" | tr -dc [:digit:] | cut -c1-7)"
5151
KEEPER_ID_03="$( echo "${KEEPER_HOST_03}" | tr -dc [:digit:] | cut -c1-7)"
5252

53-
# Identify the node type this is as this will influence how the config is constructed
54-
# TODO(https://github.com/oxidecomputer/omicron/issues/3824): There are probably much better ways to do this service name lookup, but this works
55-
# for now. The services contain the same IDs as the hostnames.
53+
# Identify the node type this is as this will influence how the config is
54+
# constructed
55+
# TODO(https://github.com/oxidecomputer/omicron/issues/3824): There are
56+
# probably much better ways to do this service name lookup, but this works for
57+
# now. The services contain the same IDs as the hostnames.
5658
KEEPER_SVC="$(zonename | tr -dc [:digit:] | cut -c1-7)"
5759
if [[ $KEEPER_ID_01 == $KEEPER_SVC ]]
5860
then
@@ -68,9 +70,9 @@ else
6870
exit "$SMF_EXIT_ERR_CONFIG"
6971
fi
7072

71-
# Setting environment variables this way is best practice, but has the downside of
72-
# obscuring the field values to anyone ssh=ing into the zone. To mitigate this,
73-
# we will be saving them to ${DATASTORE}/config_env_vars
73+
# Setting environment variables this way is best practice, but has the downside
74+
# of obscuring the field values to anyone ssh=ing into the zone. To mitigate
75+
# this, we will be saving them to ${DATASTORE}/config_env_vars
7476
export CH_LOG="${DATASTORE}/clickhouse-keeper.log"
7577
export CH_ERROR_LOG="${DATASTORE}/clickhouse-keeper.err.log"
7678
export CH_LISTEN_ADDR=${LISTEN_ADDR}
@@ -103,7 +105,7 @@ CH_KEEPER_HOST_03="${CH_KEEPER_HOST_03}""
103105

104106
echo $content >> "${DATASTORE}/config_env_vars"
105107

106-
# The clickhouse binary must be run from within the directory that contains it.
108+
# The clickhouse binary must be run from within the directory that contains it.
107109
# Otherwise, it does not automatically detect the configuration files, nor does
108110
# it append them when necessary
109111
cd /opt/oxide/clickhouse_keeper/

smf/profile/profile

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ case "$HOSTNAME" in
1212
oxz_crucible*)
1313
PATH+=:/opt/oxide/crucible/bin
1414
;;
15-
oxz_clockhouse*)
16-
PATH+=:/opt/oxide/clickhouse
15+
oxz_clickhouse*)
16+
PATH+=:/opt/oxide/clickhouse:/opt/oxide/clickhouse_keeper
1717
;;
1818
oxz_external_dns*|oxz_internal_dns*)
1919
PATH+=:/opt/oxide/dns-server/bin

0 commit comments

Comments
 (0)