Skip to content

Implement remote_servers fragmentation via ConfigMaps#1948

Open
shankeleven wants to merge 1 commit intoAltinity:0.27.0from
shankeleven:config_map_partition
Open

Implement remote_servers fragmentation via ConfigMaps#1948
shankeleven wants to merge 1 commit intoAltinity:0.27.0from
shankeleven:config_map_partition

Conversation

@shankeleven
Copy link
Copy Markdown

Partition remote_servers into ConfigMap fragments

Motivation

Large ClickHouse clusters can generate remote_servers.xml exceeding Kubernetes ConfigMap size limits (~1 MiB), causing reconcile failures.
Solves #1874

What this PR does

  • Splits remote_servers.xml into deterministic fragments when size exceeds threshold

  • Adds configuration:

    clickhouse:
      configuration:
        remoteServers:
          remoteServersSplitThresholdBytes: 614400  # 600 KiB
          maxRemoteServersFragments: 100
  • Preserves legacy behavior when size is below threshold

  • Uses projected volume to mount fragments transparently

  • Adds hash annotation to trigger deterministic pod rollout

  • Implements safe GC:

    • post-StatefulSet reconcile
    • on CHI deletion

Testing

  • Unit tests for fragmentation logic and edge cases

  • E2E tests for:

    • fragment creation & mounting
    • GC after scale-down
    • max fragment failure scenario

Result

  • This removes ConfigMap-size-related reconciliation risk for large deployments while keeping behavior unchanged for clusters that do not require fragmentation.

Add remote_servers fragment generation and naming, wire projected config.d mounts, reconcile/GC shard ConfigMaps, and include runtime + config updates with e2e coverage for fragmentation and max-fragment failure behavior.

Signed-off-by: shankeleven <shashanksati11@gmail.com>
@shankeleven
Copy link
Copy Markdown
Author

@sunsingerus @alex-zaitsev could you please review this PR

@sunsingerus sunsingerus changed the base branch from 0.26.1 to 0.27.0 March 26, 2026 14:09
@sunsingerus sunsingerus added research required This issue requires additional research planned for review This feature is planned for review labels Mar 26, 2026
@Slach Slach requested a review from sunsingerus March 30, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

planned for review This feature is planned for review research required This issue requires additional research

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants