Repository navigation
refactor: group client-facing listener flags (M2 part 5) - #1441
Merged
Merged
Conversation
Move the Redis, DynamoDB, S3 and SQS listener flags, the Redis Lua pool size, and the metrics and pprof endpoints into listenerFlags on serverFlags. Runtime config parsing, the server runner, the Redis server and the admin listener (which reuses the S3 credentials file) receive the values instead of reading package globals. No flag name, default or help text changes. Signed-off-by: bootjp <contact@bootjp.me>
Signed-off-by: bootjp <contact@bootjp.me>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
bootjp
added a commit
that referenced
this pull request
Nov 12, 2026
…t 6) (#1442) Design: docs/design/2026_11_12_partial_root_package_decomposition.md M2 part 6. It is stacked on #1441, so retarget it to `main` once #1441 merges. It moves the node identity, cluster topology and consistency rollout-gate flags out of package globals. ## Changes - `raftFlags` (`main_runtime_config.go`): `--address`, `--raftId`, `--raftEngine`, `--raftDataDir`. - `topologyFlags` (`main_runtime_config.go`): `--raftGroups`, `--shardRanges`, `--raftRedisMap`, `--raftS3Map`, `--raftDynamoMap`, `--raftSqsMap`, `--sqsFifoPartitionMap`. The HT-FIFO comment moved onto the struct. - `consistencyFlags` (`main_commit_ts_fence.go`): `--commitTSFence`, `--readWatermarkAdvance`. - `resolveNetworkRuntimeInputs` and `resolveValidatedRuntimeInputs` now take `*serverFlags`, so the parameter lists stop growing with each part. `resolveRuntimeInputs` takes the raft, topology and listener values. - Each of these now gets the values it needs as parameters: - `loadKEKAfterPreNonceStartupGuards`: Raft ID and data dir. - `prepareAdminFromFlags`: Raft ID. - `startRaftServers`: Raft ID and `readWatermarkAdvance`. - The server runner and S3 blob cluster: Raft ID. - Snapshot offload, via `distributionStartupInput`: data dir. - `serversInput`: node address and consistency flags. - **Not in this PR:** the bootstrap and join flags (`--raftBootstrap`, `--raftBootstrapMembers`, `--raftGroupPeers`, `--raftJoinMembers`, `--raftJoinAsLearner`, `--raftBootstrapPeerConfigDir`). The protected-bootstrap e2e fixtures read or overwrite them deep inside group construction, so they get their own part. ## Behavior change None. Flag names, defaults and help text are unchanged: `-help` output is identical to the base. ## Risk Low. The values are read-only after parsing. Every former global read now gets the same value through a parameter or struct field. ## Test evidence - `go test -race -count=1 .`: ok (229s). - `golangci-lint`: 0 issues. - `scripts/check-production-imports.sh`: ok. - `-help` output: identical to the base binary. - Test list: identical apart from the new `TestRaftTopologyConsistencyFlagsDefaultsAndParsing` and `TestRuntimeInputsRequireRaftID`. - `TestRuntimeInputsRejectCommitTSFenceBeforeOpeningStores` no longer overwrites a global and runs `t.Parallel`. - Jepsen: not run. Nothing in replication, MVCC or OCC changed. ## Self-review 1. **Data loss**: no write, apply or persistence path changes. The data dir reaches the KEK guard, shard groups and snapshot offload unchanged. 2. **Concurrency**: the values are immutable after parsing. 3. **Performance**: start-up only. `readWatermarkAdvance` is still decided once per server build. 4. **Consistency**: the commit-ts fence and read-watermark gates read the same parsed booleans in the shard store, the coordinator, Internal RPC options and the public-service start. 5. **Test coverage**: new tests pin the defaults, parsing and the required `--raftId` check. The commit-ts fence test now builds its flags explicitly.
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.
Design: docs/design/2026_11_12_partial_root_package_decomposition.md
M2 part 5, following #1440. It moves the client-facing listener flags out of package globals into
listenerFlags, which is registered on the FlagSet and passed down fromrun().Changes
listenerFlags(main_public_servers.go) holds 15 flags:--redisAddress,--redisLuaMaxIdleStates.--dynamoAddress.--s3Address,--s3Region,--s3CredentialsFile,--s3PathStyleOnly.--sqsAddress,--sqsPublicEndpoint,--sqsRegion,--sqsCredentialsFile.--metricsAddress,--metricsToken,--pprofAddress,--pprofToken.resolveNetworkRuntimeInputs→resolveValidatedRuntimeInputs→resolveRuntimeInputspass it toparseRuntimeConfig.serversInputcarries it. TheruntimeServerRunnerfields it already had are now filled from it.prepareRedisServertakes the Lua pool size as a parameter.prepareAdminFromFlagstakes the S3 credentials file (the admin listener reuses it) as a parameter.--addressstays a global for now. It is the node's Raft address and belongs with the Raft topology flags in the next part.Behavior change
None. Flag names, defaults and help text are unchanged:
-helpoutput is identical to the base.Risk
Low. The values are read-only after parsing, so passing them as copies changes nothing.
Test evidence
go test -race -count=1 .: ok (225s).golangci-lint: 0 issues.scripts/check-production-imports.sh: ok.-helpoutput: identical to the base binary.TestListenerFlagsDefaultsAndParsing.Self-review