Skip to content

Allow sharding on a one-replica cluster - #15

Merged
austin-barrington merged 3 commits into
mainfrom
feat/sharding-n1-cluster
Sep 7, 2026
Merged

austin-barrington merged 3 commits into
mainfrom
feat/sharding-n1-cluster

Conversation

@austin-barrington

Copy link
Copy Markdown
Member

Summary

  • Webhook no longer rejects sharding.enabled at replicas=1.
  • A 1-replica CR with explicit sharding writes [cluster] enabled=true (a 1-member cluster), not cluster-off. Defaults stay off when sharding is omitted or disabled.

Pairs with the server PR that lets a 1-member sharded process own regions after the first write.

Test plan

  • go test ./api/v1alpha1/ ./internal/hyperbytedb/
  • Create a 1-replica CR with spec.sharding.enabled=true and confirm config.toml has both [sharding] enabled=true and [cluster] enabled=true
  • Confirm a 1-replica CR without sharding still has [cluster] enabled=false

Made with Cursor

austin-barrington and others added 3 commits September 4, 2026 22:53
A CR with replicas=1 and sharding.enabled now writes [cluster] enabled=true instead of being rejected or running cluster-off.
`controller-gen` was not re-run after the `Sharding` field doc changed, so
the shipped CRD still told users that enabling sharding requires
replicas > 1 — the rule the previous commit removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Te8YUXjjLssk3hxwoE5Db
Only *explicit* sharding turns a 1-replica CR into a one-member cluster.
The enabling half was tested; the opt-out half was not, so a regression
making `clusterMetadataEnabled` ignore the `Enabled` field would have gone
unnoticed. Assert both an omitted and an explicitly disabled sharding
block leave the config cluster-off.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Te8YUXjjLssk3hxwoE5Db
@austin-barrington
austin-barrington merged commit c38ae36 into main Sep 7, 2026
4 checks passed
@austin-barrington
austin-barrington deleted the feat/sharding-n1-cluster branch September 7, 2026 07:32
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