Skip to content

fix: fallback to reported indexer statuses after prediction failures#359

Merged
Theodus merged 2 commits intomainfrom
theodus/backoff
Jul 21, 2023
Merged

fix: fallback to reported indexer statuses after prediction failures#359
Theodus merged 2 commits intomainfrom
theodus/backoff

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Jul 21, 2023

The gateway's current strategy for predicting is optimized for keeping responses close to chain head. We've recently seen instances where indexers are stuck far behind chain head, potentially due to IPFS data availability issues. The gateway's predictions are not cutting it in these scenarios where blocks_behind values are constantly increasing.

This PR adds an exponential backoff to the latest_block input to indexer selection when retries are necessary due to indexers failing to resolve the requested block hash. This also adds a more aggressive fallback based on the reported block statuses of available indexers.

This is not an ideal solution, since it adds more complexity to one of the most complex interactions in the gateway. I intend to completely rework this soon. But it will likely require support on the indexer side.

@Theodus Theodus requested a review from LNSD July 21, 2023 00:57
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@Theodus Theodus merged commit 5633b5e into main Jul 21, 2023
@Theodus Theodus deleted the theodus/backoff branch July 21, 2023 14:25
@Theodus Theodus mentioned this pull request Jul 21, 2023
Theodus added a commit that referenced this pull request Jul 21, 2023
# Release Notes
- fix: fallback to reported indexer statuses after prediction failures
(#359)
- fix: avoid duplicate indexer selections (#358)
- Upgrade deps & update clippy warnings (#357)
- Remove support for restricted deployments (#355)
- Add some more docs for config options (#354)
- refactor(graph-gateway): change crate entry point from main.rs to
lib.rs (#352)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants