Repository navigation
feat(cli): connect to several addresses and follow the primary (chunkdb/chunkdb#155) - #60
Merged
Merged
Conversation
Accept ordered endpoint lists in connection URIs and flags. Resolve the serving primary with HELLO and table status before sending statements. Rediscover after follower refusals and transport failures without replaying writes. Resume table watches from their last processed position and surface resync. Keep interrupted shell transactions blocked until ROLLBACK. Route DELETE BLOCK by FROM, scan only the routing prefix and require a direct endpoint for node-local commands. Skip peers in recovery and retry ambiguous observations or temporary admission limits within the discovery budget. Explain the discovery grants for replication watches, check for a changed primary after a slot failure and preserve TAKEOVER until the first attach attempt.
Replace the assertion that --table is unknown with coverage for the routing table, ordered endpoint flags, missing arguments and invalid ports. The existing users test expects permission-denial output that predates the server's right and table metadata. The mismatch also applies to the single-address path on main. Match discovery and slot-watch fixtures to the server's permission metadata and default recovery and missing-slot reason keys.
# Conflicts: # cmd/chunk-cli/main.go
Decode stderr as one JSON object and check the error code, class and reason fields. A follower refusal includes its reason in both the summary and the server key map.
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.
Part of chunkdb/chunkdb#155 (Clients accept several addresses, find the current primary and reconnect after a failover).
Accept comma-separated URI endpoints and repeatable --endpoint options. The CLI checks the target table's serving state and uses bounded ordered discovery on connect and reconnect. It skips known recovery states and repeats inconclusive or ambiguous sweeps within the discovery budget. Node-local commands require a direct connection, and routed data statements check the table from the CQL prefix.
The shell reconnects on the new primary and requires ROLLBACK to clear an interrupted transaction before sending more statements. One-shot commands and transaction files preserve the failed statement's error and exit status. Table watches pass their last processed epoch and revision to the new primary. They report resync if the server cannot prove continuity, preserve TAKEOVER through setup, and reattach after a slot failure only when the primary address or table epoch changed. Replication watches explain any missing discovery grant.
Fake-server tests cover role and permission checks, recovering peers, admission refusals, discovery bounds, promotion during a sweep, persistent ambiguity, node-local command rejection, DELETE BLOCK routing, interrupted shell transactions, lost write and COMMIT replies, watch continuity, takeover, missing slots and replication gaps. URI and routing tests cover address parsing and allocation-free routing checks. These tests are pending CI.
This completes the CLI portion of the box. The Go and JavaScript clients have separate changes.