-
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
Scale out Clickhouse to a multinode cluster #3494
Changes from 1 commit
0b21df2
3281cbd
b628be6
cdfb1d1
41518c8
795327e
73e5e22
83449a2
38fb86d
06b8f21
b5dd484
ca7ad33
bbbbd28
7b7b245
72cc038
34f370b
79dd329
94f8376
cea0612
95be228
e24a2dd
f6aac77
758fd39
ef914b1
7eb06dd
1abe9dd
e2a4060
9c759e6
bc33e97
1ebcf14
23df4ef
80eb1d1
2b1edd9
5fd1e75
3bda6b3
2492ae8
8541d17
148dda9
cb0cd66
b9e64cd
9d8d019
81ab2ad
a8a02d4
c116370
28354be
9562f0e
9520449
8872b09
3af0769
f621b80
e51bd0f
298ca4e
1930e14
e7a4635
b8ccf29
d83dc85
691d9d5
4a1c179
fe124fd
7f67c7b
251df8a
c58c8fe
4832dda
c7e3598
0adffb7
98c705b
77a3492
5933f51
6c82c8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- CRDB documentation recommends the following: | ||
-- "Execute schema changes either as single statements (as an implicit transaction), | ||
-- or in an explicit transaction consisting of the single schema change statement." | ||
-- | ||
-- For each schema change, we transactionally: | ||
-- 1. Check the current version | ||
-- 2. Apply the idempotent update | ||
|
||
BEGIN; | ||
|
||
SELECT CAST( | ||
IF( | ||
( | ||
SELECT version = '4.0.0' and target_version = '4.0.1' | ||
FROM omicron.public.db_metadata WHERE singleton = true | ||
), | ||
'true', | ||
'Invalid starting version for schema change' | ||
) AS BOOL | ||
); | ||
|
||
ALTER TYPE omicron.public.dataset_kind ADD VALUE IF NOT EXISTS 'clickhouse_keeper'; | ||
|
||
COMMIT; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ route get -inet6 default -inet6 "$GATEWAY" || route add -inet6 default -inet6 "$ | |
single_node=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will this be changed? We'll make a commit which changes it? At that point, when we boot this new zone...what happens? There already is a database There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been mulling it over, but tbh I can't say I have a clear answer as to which steps we'll take for the migration (or perhaps remove everything and start from scratch?). I was planning on having that discussion here -> #4000 I think a lot of it also depends on "how" Nexus will provision services. If we are able to perform a one off job for the migration, we may be able to use |
||
|
||
command=() | ||
# TODO: Remove single node mode once all racks are running in replicated mode | ||
# TODO((https://github.com/oxidecomputer/omicron/issues/4000)): Remove single node mode once all racks are running in replicated mode | ||
if $single_node | ||
then | ||
command+=( | ||
|
@@ -94,8 +94,9 @@ else | |
fi | ||
|
||
# Identify the node type this is as this will influence how the config is constructed | ||
# TODO: There are probably much better ways to do this service discovery, but this works | ||
# for now. The services contain the same IDs as the hostnames. | ||
# TODO(https://github.com/oxidecomputer/omicron/issues/3824): There are probably much | ||
# better ways to do this service discovery, but this works for now. | ||
# The services contain the same IDs as the hostnames. | ||
CLICKHOUSE_SVC="$(zonename | tr -dc [:digit:])" | ||
REPLICA_IDENTIFIER_01="$( echo "${REPLICA_HOST_01}" | tr -dc [:digit:])" | ||
REPLICA_IDENTIFIER_02="$( echo "${REPLICA_HOST_02}" | tr -dc [:digit:])" | ||
|
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.
FWIW in my original recommendation, I figured it would have been the following, within a single file named
4.0.0/up.sql
, but what you have done works too.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.
thnx!