Skip to content

[helm] Support multi-disk data.dirs for tablet servers - #4114

Draft
morazow wants to merge 2 commits into
apache:mainfrom
morazow:helm-multi-disk-data-dirs
Draft

[helm] Support multi-disk data.dirs for tablet servers#4114
morazow wants to merge 2 commits into
apache:mainfrom
morazow:helm-multi-disk-data-dirs

Conversation

@morazow

@morazow morazow commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes [helm] Support multi-disk data.dirs in the tablet StatefulSet #4106
  • Adds tablet.storage.volumes to the Helm chart: a list of {name, size, storageClass} entries, each rendering its own volumeClaimTemplates entry (or emptyDir when tablet.storage.enabled=false) mounted at /tmp/fluss/<name>.
  • When the list is non-empty the chart emits data.dirs with all mount paths in server.yaml, so tablet servers balance log and KV storage across the disks. data.dirs takes precedence over data.dir server-side, so the default configurationOverrides.data.dir stays harmless.
  • Backward compatible: with the list empty (the default) the chart renders byte-identical output to main - one data claim sized by tablet.storage.size, no data.dirs line - so existing releases see no StatefulSet storage change on upgrade.
  • Template-time validation rejects entries missing name or size, duplicate or chart-reserved volume names (fluss-conf, sasl-config, secret-*), and a configurationOverrides."data.dirs" that would conflict with the generated one.
  • Docs: new "Multiple Disks per Tablet Server (JBOD)" section in deploying-with-helm.md, including the migration caveat that volumeClaimTemplates are immutable (orphan-delete the StatefulSet or install a fresh release).

Test Plan

  • helm lint ./helm && helm unittest ./helm (what helm-chart.yaml CI runs): 159 tests pass, including the new helm/tests/storage_test.yaml covering default emptyDir, legacy single-PVC, multi-volume claims + mounts + data.dirs, single-entry list, disabled-storage multi-emptyDir, coexistence with extraVolumes/extraVolumeMounts, and all five validation failures.
  • Verified helm template output is byte-identical to main for default values and for the legacy single-disk configuration (enabled=true + size + storageClass).

🤖 AI-assisted changes - reviewed by human developer

Add tablet.storage.volumes, a list of {name, size, storageClass} entries.
Each entry renders its own volumeClaimTemplate (or emptyDir when storage
is disabled) mounted at /tmp/fluss/<name>, and the chart emits data.dirs
with all mount paths in server.yaml so tablet servers balance data across
the disks. With the list empty, the chart renders exactly what it does
today: one 'data' claim sized by tablet.storage.size and no data.dirs
line, so existing releases see no StatefulSet storage change on upgrade.

Template-time validation rejects entries missing name or size, duplicate
or chart-reserved volume names, and a configurationOverrides data.dirs
that would conflict with the generated one.
Review findings on apache#4114:
- Guard the data.dirs conflict check with 'default dict' so a nulled-out
  configurationOverrides renders instead of crashing hasKey (matches the
  chart's existing _metrics.tpl pattern).
- Reject volume names that are not lowercase DNS-1123 labels at template
  time; previously a bad name passed lint and failed only at the API
  server, and a comma would silently corrupt the joined data.dirs value.
- Emit claim size and storageClass via toYaml so string values that look
  like another YAML type (e.g. storageClass "1234") stay strings; nil
  storageClass still renders empty, keeping single-disk output identical.
- Lock the volumeMounts order in the extraVolumeMounts test with a full
  equal assert instead of order-insensitive contains.
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.

[helm] Support multi-disk data.dirs in the tablet StatefulSet

1 participant