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

Allow creating a new Cluster with alive and down nodes #5

Closed
nfo opened this issue Dec 16, 2021 · 5 comments
Closed

Allow creating a new Cluster with alive and down nodes #5

nfo opened this issue Dec 16, 2021 · 5 comments

Comments

@nfo
Copy link

nfo commented Dec 16, 2021

Scenario:

  • I call hasql.NewCluster with three nodes. One node is unreachable ("context deadline exceeded").
  • All further calls to Cluster.WaitFor* return an error.
  • Calls to Cluster.Alive, Cluster.Primary* and Cluster.Standby* return nil.

Expected: Being able to create a cluster which includes unreachable nodes and still be able to query the alive nodes.

@nfo nfo changed the title Allow creating a new Cluster with up and down nodes Allow creating a new Cluster with alive and down nodes Dec 16, 2021
@bbrodriges bbrodriges reopened this Mar 5, 2022
@vtolstov
Copy link

do you plan to fix this ?

@bbrodriges
Copy link
Contributor

Yes, there will be fix soon

@vtolstov
Copy link

any news ?=)

@bbrodriges
Copy link
Contributor

any news ?=)

Upon deep inspection I can assume that this is a problem with context.Context provided to WaitFor/Alive/Primary. Provided context must be greater than refreshInterval+refreshTimeout duration, in other case ContextDeadlineExceeded will be returned.

As I can see there is no problem with partially available cluster in checkNodes function - https://github.com/yandex/go-hasql/blob/master/check_nodes.go#L96

Can you provide a bit more context to problem, a reproducer may be?

@bbrodriges
Copy link
Contributor

Please read this comment, it may help you to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants