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

Upgrade clickhouse to 23.8 #3009

Merged
merged 10 commits into from
May 6, 2024
Prev Previous commit
Next Next commit
check to see if it is an upgrade
  • Loading branch information
hubertdeng123 committed May 2, 2024
commit 4cf5b79cc5c495ac9275e0c663ae046bdf0dacb9
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ source install/check-minimum-requirements.sh
# Let's go! Start impacting things.
source install/turn-things-off.sh
source install/update-docker-volume-permissions.sh
source install/upgrade-clickhouse.sh
source install/create-docker-volumes.sh
source install/ensure-files-from-examples.sh
source install/check-memcached-backend.sh
source install/ensure-relay-credentials.sh
source install/generate-secret-key.sh
source install/update-docker-images.sh
source install/upgrade-clickhouse.sh
source install/build-docker-images.sh
source install/install-wal2json.sh
source install/bootstrap-snuba.sh
Expand Down
19 changes: 11 additions & 8 deletions install/upgrade-clickhouse.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
echo "${_group}Upgrading Clickhouse ..."

# In order to get to 23.8, we need to first upgrade go from 21.8 -> 22.8 -> 23.3 -> 23.8
$dc up -d clickhouse
version=$($dc exec -it clickhouse clickhouse-client -q 'SELECT version()')
if [[ "$version" == "22.8.15.25.altinitystable" || "$version" == "21.8.12.29.altinitydev.arm" ]]; then
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:22.8.15.25.altinitystable clickhouse
# First check to see if user is upgrading by checking for existing clickhouse volume
if [[ -n "$(docker volume ls -q --filter name=sentry-clickhouse)" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder if it's worth adding a test for this? Should (hopefully) be pretty straightforward with the new python-based testing regime?

Copy link
Member Author

Choose a reason for hiding this comment

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

Editing the install script is not easily tested using the new python tests. Those are effective after self-hosted sentry is installed and up and running. The new self-hosted Sentry upgrade tests I added sufficiently covers this IMO, it skips over this portion of the code on initial install and hits this on the upgrade

# In order to get to 23.8, we need to first upgrade go from 21.8 -> 22.8 -> 23.3 -> 23.8
$dc up -d clickhouse
version=$($dc exec -it clickhouse clickhouse-client -q 'SELECT version()')
if [[ "$version" == "22.8.15.25.altinitystable" || "$version" == "21.8.12.29.altinitydev.arm" ]]; then
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:22.8.15.25.altinitystable clickhouse
$dc up -d clickhouse
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:23.3.19.33.altinitystable clickhouse
fi
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:23.3.19.33.altinitystable clickhouse
fi
$dc down clickhouse
Loading