Allow sharding on a one-replica cluster - #15
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sharding.enabledatreplicas=1.[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/spec.sharding.enabled=trueand confirm config.toml has both[sharding] enabled=trueand[cluster] enabled=true[cluster] enabled=falseMade with Cursor