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.

@lutter lutter force-pushed the lutter/zero-weight branch from 2d7dc36 to 19da159 Compare August 27, 2021 21:15
@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;

@lutter lutter force-pushed the lutter/zero-weight branch from 19da159 to ff93613 Compare August 27, 2021 22:13
@lutter lutter merged commit ff93613 into master Aug 27, 2021
@lutter lutter deleted the lutter/zero-weight branch August 27, 2021 22:14
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.

2 participants