Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery doesn't determine mode (RW/RO) of all instances in replica set using URI #1034

Open
mandesero opened this issue Nov 24, 2024 · 0 comments
Labels
2sp bug Something isn't working teamE

Comments

@mandesero
Copy link
Contributor

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:

  1. Start tarantool application (vshard cluster in my case).

  2. Run the tt replicaset status command with a URI:

    $ tt replicaset status tcp://client:[email protected]:3301
  3. 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
    
  4. Run the same command using a cluster name:

    $ tt replicaset status new-app
  5. 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

for i, _ := range topology.Instances {
if topology.Instances[i].UUID == topology.InstanceUUID {
if topology.InstanceRW {
topology.Instances[i].Mode = ModeRW
} else {
topology.Instances[i].Mode = ModeRead
}
}
}

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: #1030 (comment)

@mandesero mandesero changed the title Discovery doesn't determine mode (RW/RO) of all instances in replica set sing URI Discovery doesn't determine mode (RW/RO) of all instances in replica set using URI Nov 24, 2024
@oleg-jukovec oleg-jukovec added 2sp bug Something isn't working teamE labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2sp bug Something isn't working teamE
Projects
None yet
Development

No branches or pull requests

2 participants