Discovery doesn't determine mode (RW/RO) of all instances in replica set using URI
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 113
- Forks
- 18
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 23
Description
Description
The Discovery mechanism doesn't determine the mode of all instances in a replica set when using the URI. This results in some instances being marked with an unknown state, despite the correct address for connection is known.
Example:
-
Start tarantool application (vshard cluster in my case).
-
Run the
tt replicaset statuscommand with a URI:$ tt replicaset status tcp://client:secret@127.0.0.1:3301 -
The output shows an incorrect state for one of the instances:
Orchestrator: centralized config Replicasets state: bootstrapped • storage-001 Failover: manual • storage-001-a localhost:3301 rw • storage-001-b localhost:3302 unknown -
Run the same command using a cluster name:
$ tt replicaset status new-app -
The output is correct:
Orchestrator: centralized config Replicasets state: bootstrapped • storage-001 Failover: manual Master: single • storage-001-a localhost:3301 rw • storage-001-b localhost:3302 read
My attempts
For example for centralized config applications, the instance operating mode is assigned here
If URI is provided in tt command, topology.InstanceUUID is the URI of the instance with the provided URI, so the check is performed only for the single instance, the rest remain in the ModeUnknown state.
I tried hardcoding a solution by passing connOpts, iterating over the instances, and collecting their modes. However, it seems that this issue requires a more thorough investigation, as the mechanism is used in multiple places.
$ tt replicaset status tcp://client:secret@localhost:3302
Orchestrator: centralized config
Replicasets state: bootstrapped
• storage-001
Failover: manual
Master: single
• storage-001-a localhost:3301 rw
• storage-001-b localhost:3302 read
Patch: https://github.com/mandesero/tt/tree/mandesero/discovery-hot-fix
Discussion: https://github.com/tarantool/tt/pull/1030#issuecomment-2488762044
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in cli/replicaset/cconfig.go around lines 266-274, then trace how Discovery uses topology.InstanceUUID when the command receives a URI. Compare the URI and cluster-name outputs and inspect the related discovery paths mentioned in the issue. Done means tt replicaset status determines the RW/RO mode for every instance instead of leaving known instances as unknown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100