Repository navigation
ClickHouse 26.8: pin synchronous inserts, 26.8-safe fixtures, CI on 26.8 - #11
Merged
Merged
Conversation
Countly's ClickHouse runs its default profile with async_insert=1, so the staging inserts silently became async inserts. The verify-then-attach count right after an insert relies on an ack meaning the rows are written, which then held only while wait_for_async_insert stays on (an env knob there). The client now sets async_insert=0 itself. ts/cd/lu are already written as quoted datetime strings, so the 26.8 change that reads a bare JSON number for DateTime64 as seconds does not reach the migrator's writes, with or without input_format_read_datetime_number_as_raw_value. Test fixtures did write bare millisecond numbers into ts in VALUES, which stores 9999-12-31 on a 26.8 server without that setting; they now use fromUnixTimestamp64Milli. The ledger e2e test now creates the platform's drill_events DDL (codecs, cd index, object serialization settings) and asserts exact stored ts/cd/lu and partitions, no 9999 rows, and that every insert ran with async_insert=0. CI moves from ClickHouse 26.4 to the stock 26.8 image (no Countly profile, the strictest case); the opt-in outage test defaults to 26.8 too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kanwarujjaval
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
countly-platform now runs ClickHouse 26.8 (floor 26.8.6). Two things in that move reach the migrator:
DateTime64column as seconds, so a millisecond epoch lands on9999-12-31unlessinput_format_read_datetime_number_as_raw_value=1(platform runbook:docs/runbooks/clickhouse-26.8-upgrade.md).defaultprofile setsasync_insert=1(deploy/compose/clickhouse/users.d/async-insert.xml, Helmcountly-clickhouseprofile). The migrator never set it, so its staging inserts silently became async inserts.What changes
StagingManagersetsasync_insert: 0on its client. Verify-then-attach counts rows right after an insert and needs an ack to mean the rows are written. Under the profile that held only whilewait_for_async_insertstays on, which is an env knob there (CLICKHOUSE_WAIT_FOR_ASYNC_INSERT).ts/cd/luare written as quotedyyyy-MM-dd HH:mm:ss.SSSstrings, which parse the same on every version with or without the setting. A comment there now says why they must stay strings.tsinVALUESnow usefromUnixTimestamp64Milli(...). On a 26.8 server without the setting, a bare number stores9999-12-31.drill_eventsDDL (codecs,cd_minmax, object serialization settings) and asserts:ts/cd/luand partitions;async_insert=0(fromsystem.query_log).clickhouse-server:26.4to stock26.8. The stock image has no Countly profile, so the raw-value setting is off: the strictest case, as on an external ClickHouse. The opt-in outage test defaults to 26.8 too.Already compatible, no change needed:
sanitizeJsonValuealready stringifies them with the same bounds as the platform'seventTransformer.ts.Number(), and the cd checksum is reduced mod 2^32, so nothing exceeds 2^53. Content sampling compares timestamps as text and JSON columns by key set.How it was tested
Run against ClickHouse 26.8.17 with Countly's production profile (
async_insert=1, raw-value=1) and MongoDB 8.3:query_logshowed every staging insert as an async insert.vitest run tests/differential tests/integrationpasses: 174 passed, 1 skipped (opt-in outage).async_insert: 0line removed, the new e2e assertion fails (['1']vs['0']), so it guards the pin.ts/lu/cd(2025-09-04). A bare-number control row stored9999-12-31.🤖 Generated with Claude Code