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

node: check that at least one replica for each shard has a non-zero weight #2749

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

lutter
Copy link
Collaborator

@lutter lutter commented Aug 27, 2021

No description provided.

@evaporei
Copy link
Contributor

Just for future context, this is being added because an indexer bumped into this error:

thread 'tokio-runtime-worker' panicked at 'attempt to calculate the remainder with a divisor of zero', store/postgres/src/deployment_store.rs:1039:21

That happened because their config file had only one shard which the weight was 0:

[store]
[store.primary]
connection = "postgresql://${postgres_user}:${postgres_pass}@${postgres_host}:5432/${postgres_db}?host=/var/run/postgresql"
weight = 0
pool_size = 30

[chains]
ingestor = "index_node_1"

[deployment]
[[deployment.rule]]
indexers = [ "index_node_0", "index_node_1" ]

[general]
query = "query_node_0"

The error happens because the replica_order list is empty:

self.conn_round_robin_counter.fetch_add(1, Ordering::SeqCst) % weights_count;

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

Successfully merging this pull request may close these issues.

None yet

2 participants