-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
P3Medium priority - fix when possibleMedium priority - fix when possible
Description
Problem
NumShards is hardcoded as a constant:
const (
NumShards = 6 // TODO: make configurable
...
)This limits flexibility for testing with different shard counts and production deployments.
Current Behavior
Fixed at 6 shards, cannot be changed without code modification and rebuild.
Proposed Solution
Make NumShards configurable via:
- Environment variable (e.g.,
SHARD_COUNT) - Config file (
config/config.json) - Command-line flag
Implementation
// In config package
type Config struct {
NumShards int `json:"num_shards"`
// ...
}
// In server.go
var NumShards = config.GetNumShards() // Default 6 if not setConsiderations
- Shard ID calculation uses modulo:
shardID = address % NumShards - All nodes must use same NumShards value
- Changing NumShards requires state migration (not supported initially)
Priority
P3 - Nice-to-have for flexibility. Current hardcoded value works for development.
Location
internal/shard/server.go:967
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Medium priority - fix when possibleMedium priority - fix when possible