Skip to content

chore(warehouse): drop the v2 suffix now v1 is gone - #7416

Closed
achettyiitr wants to merge 2 commits into
chore/clickhouse-remove-v1from
chore/clickhouse-promote-v2-names
Closed

achettyiitr wants to merge 2 commits into
chore/clickhouse-remove-v1from
chore/clickhouse-promote-v2-names

Conversation

@achettyiitr

Copy link
Copy Markdown
Member

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.go with the deleted one, so the removal reads as a 1,258-line rewrite instead of a delete. Stacked on top, clickhouse.go no longer exists in the base, so every move below shows as a rename.

Renames

From To
clickhousev2.go clickhouse.go
load_v2.go load.go
driver_v2.go driver.go
binder_v2.go binder.go
stats_v2.go stats.go
*_v2_test.go *_test.go
testdata/docker-compose.clickhouse-v2.yml testdata/docker-compose.clickhouse.yml

Type ClickhouseV2 → Clickhouse, NewV2 → New, and the logger drops its v2 child so lines read integrations.clickhouse again.

Config

Settings are read from Warehouse.clickhouse.v2.* first and Warehouse.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, the v2. keys can be dropped.

Test plan

Linear Ticket

https://linear.app/rudderstack/issue/INT-7053/cleanup

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Renames and a config-key fallback only. Credential masking is untouched and still covered by TestS3CredentialsRegexV2.

🤖 Generated with Claude Code

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
.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
@achettyiitr

Copy link
Copy Markdown
Member Author

Superseded by #7418, which targets master (via #7417) instead of release/1.87.x.

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)
@github-actions
github-actions Bot deleted the chore/clickhouse-promote-v2-names branch November 24, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant