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

feat: Bump dev clickhouse version to 23.11 #19434

Merged
merged 19 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.10.10']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.6.1.1524']
clickhouse-server-image:
['clickhouse/clickhouse-server:23.6.1.1524', 'clickhouse/clickhouse-server:23.11.2.11-alpine']
segment: ['FOSS', 'EE']
person-on-events: [false, true]
# :NOTE: Keep concurrency and groups in sync
Expand Down Expand Up @@ -306,8 +307,13 @@ jobs:
retention-days: 5

async-migrations:
name: Async migrations tests
name: Async migrations tests - ${{ matrix.clickhouse-server-image }}
needs: changes
strategy:
fail-fast: false
matrix:
clickhouse-server-image:
['clickhouse/clickhouse-server:23.6.1.1524', 'clickhouse/clickhouse-server:23.11.2.11-alpine']
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
steps:
Expand All @@ -318,7 +324,7 @@ jobs:

- name: Start stack with Docker Compose
run: |
export CLICKHOUSE_SERVER_IMAGE_VERSION=${{ inputs.clickhouse-server-image-version }}
export CLICKHOUSE_SERVER_IMAGE_VERSION=${{ matrix.clickhouse-server-image }}
docker compose -f docker-compose.dev.yml down
docker compose -f docker-compose.dev.yml up -d

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
# Note: please keep the default version in sync across
# `posthog` and the `charts-clickhouse` repos
#
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.6.1.1524}
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.11.2.11-alpine}
Copy link
Member Author

Choose a reason for hiding this comment

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

Why alpine? it's about 15% smaller

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming that since ClickHouse uses ICU for collation that this means the merge tree ordering should be stable if a volume is reused across these images?

Copy link
Member Author

Choose a reason for hiding this comment

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

Clickhouse is really great about forwards compatibility of merge tree files on disk. You have to worry more about backwards compatibility, but even then it's really great and you can suppress things that will make it backwards incompatible (we've done that before) like with compress_primary_key. This is actually something I'll be looking to enable since we'd fail back to a version that supports it.

https://clickhouse.com/codebrowser/ClickHouse/src/Storages/MergeTree/MergeTreeIOSettings.h.html#54

Copy link
Member Author

@fuziontech fuziontech Jan 4, 2024

Choose a reason for hiding this comment

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

It's actually interesting - it won't rework the parts and so for some time (done via merge) so you'll have a mix of parts written by different version of CH

Copy link
Member Author

Choose a reason for hiding this comment

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

restart: on-failure
depends_on:
- kafka
Expand Down
22 changes: 11 additions & 11 deletions posthog/async_migrations/test/test_0010_move_old_partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ def tearDown(self):
def test_completes_successfully(self):
self.assertTrue(run_migration())

# create table + 3 move operations
self.assertEqual(len(MIGRATION_DEFINITION.operations), 4)
self.assertEqual(len(MIGRATION_DEFINITION.operations), 5)

self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '190001' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[1].sql # type: ignore
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '190001' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[1].sql, # type: ignore
)
self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '202202' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[2].sql # type: ignore
# skip over idx 2 because it's inconsistent and not important
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '202202' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[3].sql, # type: ignore
)
self.assertTrue(
"ALTER TABLE sharded_events MOVE PARTITION '204502' TO TABLE events_backup"
in MIGRATION_DEFINITION.operations[3].sql # type: ignore
self.assertIn(
"ALTER TABLE sharded_events MOVE PARTITION '204502' TO TABLE events_backup",
MIGRATION_DEFINITION.operations[4].sql, # type: ignore
)
Loading