Repository navigation
chore(warehouse): drop the v2 suffix now v1 is gone - #7416
Closed
achettyiitr wants to merge 2 commits into
Closed
achettyiitr wants to merge 2 commits into
achettyiitr wants to merge 2 commits into
Conversation
v2 is the only ClickHouse implementation, so the files, the type and the config namespace no longer need to say so. Config is read from Warehouse.clickhouse.v2.* first and Warehouse.clickhouse.* second, so config deployed against the v2 namespace keeps winning while the unprefixed name becomes canonical. Once deployments have moved, the v2 keys can be dropped. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
1 task done
.golangci.yml silences clickhouse-go's deprecated Options.Debug by path, so renaming driver_v2.go orphaned the exclusion and staticcheck failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> 🔒 Scanned for secrets using gitleaks 8.29.1
4 of 7 tasks
Member
Author
achettyiitr
added a commit
that referenced
this pull request
Sep 23, 2026
# Description v2 now carries every ClickHouse destination that has been migrated, so keeping a second implementation costs two files to hold in step, a selector that runs per destination, and an integration suite executed twice. This removes v1 and promotes v2 to be *the* ClickHouse integration rather than a variant of it. **Net: −1,562 lines** (179 added, 1,741 removed), across 10 files. The v2 files keep their `*_v2` names here. Renaming them in this PR makes git pair the new `clickhouse.go` with the deleted one, so the removal renders as a 1,258-line rewrite rather than a delete. The renames are stacked in #7416, where `clickhouse.go` no longer exists in the base and they show as renames. ## What changed **Deleted** - `clickhouse.go` — the v1 implementation (1,311 lines) - `clickhouseSelector` and `useV2Driver` in `warehouse/integrations/manager` — the factory now returns `clickhouse.New` directly - `manager_test.go` — all three of its tests covered driver selection - The v1 test helper (`connectClickhouseDB`) and its compose file **Extracted rather than deleted** — v2 has always depended on symbols that lived in v1's file, so these move to a new `schema.go` instead of disappearing: `rudderDataTypesMapToClickHouse`, `clickhouseDataTypesMapToRudder`, `datatypeDefaultValuesMap`, `clickhouseSpecificColumnNameMappings`, `clickhouseDefaultDateTime`, `errorsMappings`, the `credentials` type, `generateArgumentString`, `getClickhouseColumnTypeForSpecificColumn`, `getSortKeyTuple`, and `partitionField`. **Tests** — the `CLICKHOUSE_USE_V2` parameterisation is collapsed: one implementation, one pass. Subtests that skipped on v1 (JSON paths, native JSON columns, temporary credentials, s3Copy settings) now always run. CI drops the `clickhouse-v2` matrix entry, so the suite runs once instead of twice. ##⚠️ This switches namespaces that are still on v1 `useV2Driver` defaults to `false`, so deleting the selector moves every remaining destination onto v2 at once. From `rudder-devops`, **9 namespaces have a ClickHouse block and only 3 reference `useV2Driver`**: | Namespace | Today | |---|---| | `multi-tenant-us/hostedmtedmt` | v2, namespace-wide | | `enterprise-us/entusmtprod` | v2, one workspace | | `enterprise-in/rudderstacwqla` | v2, one workspace | | `enterprise-eu/ivendi` | **v1** | | `enterprise-eu/onefootball` | **v1** | | `enterprise-eu/ticketswapjll` | **v1** | | `enterprise-eu/rudderstacst` | **v1** | | `enterprise-us/padlet` | **v1** | | `dev-rudder/hostedmt-dev` | **v1** | **`blockSize` is the specific hazard.** It is a v1-only setting, and four of those namespaces set it — `onefootball` 250000, `ticketswapjll` 250000, `padlet` 250000, `rudderstacst` 25000. v2 has no `blockSize`; it drives commit cadence with `commitEvery`, which defaults to **1,000,000**. Those destinations would jump to batches 4-40x larger than they are tuned for, on a code path whose memory scales with batch size. Suggested sequencing rather than merging straight in: 1. Set `commitEvery` for the four `blockSize` namespaces to match their current tuning 2. Enable `useV2Driver` namespace-wide on the remaining six and let them run 3. Merge this once they are all genuinely on v2 The alternative is to merge and treat the per-destination `useV2Driver: false` escape hatch as the rollback — but that escape hatch is exactly what this PR deletes, so it would not exist. ## Test plan - [x] `go build ./...` clean - [x] `go vet ./warehouse/...` clean, `gofmt` clean - [x] Package unit tests pass (`TestS3CopySettings`, `TestCredentials`, `TestJSONPaths`, `TestPartition`, `TestRetry`, `TestBinder`) - [ ] Integration suite (`SLOW=1`, docker) — previously skipped subtests now run on every pass - [ ] Confirm the four `blockSize` namespaces have a `commitEvery` equivalent before this ships - [ ] Confirm the six v1 namespaces are on v2 and healthy before this ships ## Linear Ticket https://linear.app/rudderstack/issue/INT-7053/cleanup ## Security - [x] The code changed/added as part of this pull request won't create any security issues with how the software is being used. Deletions and renames only; no change to credential handling. The s3 credential masking path is untouched and still covered by `TestS3CredentialsRegex`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Description
Follow-up to #7410, which removes the v1 ClickHouse driver. With v1 gone, the files, the exported type and the config namespace no longer need to say "v2".
Kept separate on purpose: doing the renames in #7410 makes git pair the new
clickhouse.gowith the deleted one, so the removal reads as a 1,258-line rewrite instead of a delete. Stacked on top,clickhouse.gono longer exists in the base, so every move below shows as a rename.Renames
clickhousev2.goclickhouse.goload_v2.goload.godriver_v2.godriver.gobinder_v2.gobinder.gostats_v2.gostats.go*_v2_test.go*_test.gotestdata/docker-compose.clickhouse-v2.ymltestdata/docker-compose.clickhouse.ymlType
ClickhouseV2→Clickhouse,NewV2→New, and the logger drops itsv2child so lines readintegrations.clickhouseagain.Config
Settings are read from
Warehouse.clickhouse.v2.*first andWarehouse.clickhouse.*second. Config deployed against the v2 namespace keeps winning, while the unprefixed name becomes canonical — nothing has to move in lockstep. Once deployments migrate, thev2.keys can be dropped.Test plan
go build ./...,go vet ./warehouse/...,gofmtcleanSLOW=1, docker) in CILinear Ticket
https://linear.app/rudderstack/issue/INT-7053/cleanup
Security
Renames and a config-key fallback only. Credential masking is untouched and still covered by
TestS3CredentialsRegexV2.🤖 Generated with Claude Code