feat: Bump dev clickhouse version to 23.11 (#19434)

* feat: Bump dev clickhouse version to 23.11

* add 23.11.2.11-alpine to ci matrix as well

* async migrations count of queries 4->5

* Update query snapshots

* Update query snapshots

* debug

* matrix async migrations

* update tests

* improve test assert to actually be able to debug it when failes

* update async migration tests

* sequential tests of operations

* new partition determination is different maybe?

* tweak

* omit inconsistent partition

* remove index 2 test (inconsitent and not important)

* Update query snapshots

* Update query snapshots

* remove comment

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
James Greenhill
2024-01-03 17:51:27 -08:00
committed by GitHub
parent 3fdeff297d
commit 32d7162459
3 changed files with 21 additions and 15 deletions

View File

@@ -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
@@ -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:
@@ -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

View File

@@ -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}
restart: on-failure
depends_on:
- kafka

View File

@@ -69,18 +69,18 @@ class Test0010MoveOldPartitions(AsyncMigrationBaseTest):
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
)