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

fix: Coordinator Not Updating Redis Indexer Config #398

Merged
merged 2 commits into from
Nov 16, 2023
Merged

Conversation

darunrs
Copy link
Collaborator

@darunrs darunrs commented Nov 15, 2023

Coordinator pulls indexer config from registry upon initialization. While it runs, it continues to check each block for registry update calls. When the registry is updated, it kicks off a historical process if necessary, and updates its local indexer configurations to reflect the new config for that particular indexer.

It turns out that the local indexer config was in fact not correctly updating. It was setting the wrong key for storing the config. As a result, existing indexer updates were not being captured while new indexers would have the wrong config. Coordinator would attempt to set various status such as provisioning but the incorrect keys would lead to errors around that. And, failing to capture indexer config updates leads to runner never seeing those updates and continuing to run stale code. Restarting coordinator resolved these issues since the config is read freshly from registry, hiding these issues for some time, before they would once again reappear.

In addition to the above problem, the configuration is only updated in redis when the next matching block appears. So, if a new indexer is published without a start block, its redis config and stream will not be set until a new matching block appears. This can be problematic for developers who are the producers of blocks matching their contract filter. In that case, matching blocks may be rare, leading to a long delay before updated code is read and executed. Setting the config immediately after an update is seen eliminates such a problem.

I've fixed the particular line which was in correctly setting the key wrong, as well as set the redis config immediately after an update, to resolve the above issues.

@darunrs darunrs requested a review from a team as a code owner November 15, 2023 20:44
@darunrs darunrs linked an issue Nov 15, 2023 that may be closed by this pull request
@darunrs darunrs linked an issue Nov 15, 2023 that may be closed by this pull request
@darunrs darunrs self-assigned this Nov 15, 2023
Copy link
Collaborator

@morgsmccauley morgsmccauley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find :)

@darunrs darunrs merged commit 84d129a into main Nov 16, 2023
6 checks passed
@darunrs darunrs deleted the fixConfigUpdate branch November 16, 2023 01:20
@morgsmccauley morgsmccauley mentioned this pull request Nov 20, 2023
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.

Fix Coordinator Provisioning Status Errors
2 participants