Repository navigation
fix(clickhouse): keep the Keeper name inside the StatefulSet volume-name limit - #4133
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe ClickHouse chart now generates a bounded Keeper name. Keeper metadata and ClickHouse zookeeper hostnames use this name. Helm tests cover length boundaries, truncation, replica counts, hostname alignment, and selector behavior. ChangesClickHouse Keeper naming
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The chart now creates Keeper resources for longer application names while preserving existing names for short releases and keeping ClickHouse endpoints aligned. No current merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant HelmRelease
participant clickhouse.keeperName
participant ClickHouseKeeperInstallation
participant ClickHouseInstallation
HelmRelease->>clickhouse.keeperName: provide release name and replica count
clickhouse.keeperName->>ClickHouseKeeperInstallation: render bounded metadata.name
clickhouse.keeperName->>ClickHouseInstallation: render bounded zookeeper hostname
ClickHouseKeeperInstallation->>ClickHouseInstallation: use matching Keeper name
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ame limit clickhouse-operator derives the Keeper config volume name as chk-<chk>-deploy-confd-<cluster>-<shard>-<replica>. The CHK is named <release>-keeper and Release.Name already carries the clickhouse- prefix, so an application name longer than 15 characters pushes that volume name past 63 characters: the StatefulSet is rejected, no Keeper pod appears, and the CHK still reports Completed. The CHK name is now shortened only when it would overflow, with a short hash of the release name so two long names stay distinct, and the ClickHouse zookeeper hosts are built from the same helper. Short names render exactly as before. Signed-off-by: Yan Bondarenko <[email protected]>
03a7af7 to
24e43fc
Compare
scooby87
left a comment
There was a problem hiding this comment.
LGTM (independent cozy-review pass).
The truncation threshold is exactly the previous failure condition, so no healthy install (name <= 63) is renamed — short release names keep <release>-keeper unchanged and only already-broken names (> 63) are truncated, which makes the upgrade safe for existing keeper PVCs. The truncated name targets exactly 63 chars and the boundary case is tested. Cross-file consistency is right: object names use the truncated $keeper, while pod-label app and its selectors stay on the full name and remain internally consistent.
Verified: helm unittest 7/7; mutating the threshold turns 4 tests RED (non-vacuous); the sha256 hashes in the tests check out.
Non-blocking: in the truncation branch the name depends on the digit count of replicas, so scaling keeper across a power-of-ten boundary (9->10) recomputes the budget and renames the CHK; narrow trigger, worth a comment.
|
Successfully created backport PR for |
What this PR does
Fixes #4083.
clickhouse-operator names the Keeper config volume
chk-<chk>-deploy-confd-<cluster>-<shard>-<replica>. With the CHK called<release>-keeperandRelease.Namealready prefixed withclickhouse-, an application name longer than 15 characters pushes that volume name past 63 characters. The StatefulSet is rejected on every reconcile, no Keeper pod appears, and the CHK still reportsCompleted; the only visible signal is the KeeperWorkloadMonitorstaying atoperational: false.templates/_keeper.tplnow computes the CHK name:<release>-keeperas before when it fits, otherwise the release name is truncated and a six-character hash of the release name is appended so two long names cannot collide. The budget accounts for the width of the replica index.chkeeper.yamland the zookeepernodeslist inclickhouse.yamlboth use the helper, so the hosts ClickHouse connects to always match the CHK the operator creates. The pod label, theVMPodScrapeselector and theWorkloadMonitorstay on<release>-keeper.Names up to 15 characters render byte-for-byte as before. A release with a longer name never had a Keeper pod; on upgrade its pod-less CHK is replaced by the shortened one and the Keeper comes up.
helm unittest: 30/30 in the chart, including the newtests/keeper_name_test.yaml(short name unchanged, the exact 63-character boundary, one character past it, a very long name, a two-digit replica index, no trailing dash after truncation).Downstream repositories
Templates and tests only: no values, schema, README, defaults,
ApplicationDefinitionor tenant-facing Secret/Service names change.Release note
Summary by CodeRabbit
Bug Fixes
Tests