feat: support resilient reader config for indexer and add retry policy - #1364
feat: support resilient reader config for indexer and add retry policy#1364huangzhen1997 wants to merge 4 commits into
Conversation
|
👋 huangzhen1997, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR makes the indexer’s resilient reader policies configurable via TOML, so rate limiting / bulkhead / circuit breaker / timeout parameters are no longer hardcoded and can be tuned to mitigate downstream rate limiting.
Changes:
- Adds
[Resilience]configuration to the indexer config model and example TOML. - Introduces a
readers.NewResilienceConfig(config.ResilienceConfig)adapter that applies defaults for zero-valued config fields. - Threads the resilience configuration through reader construction (REST + Aggregator) and adds tests for the new adapter.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| indexer/pkg/readers/rest_reader.go | Adds resilience config to RestReaderConfig and passes it into NewResilientReader. |
| indexer/pkg/readers/rest_reader_test.go | Updates REST reader tests to provide a resilience config. |
| indexer/pkg/readers/resilient_reader.go | Adds adapter to convert indexer config resilience settings into reader resilience config with defaults. |
| indexer/pkg/readers/resilient_reader_test.go | Adds unit tests for NewResilienceConfig defaulting/overrides behavior. |
| indexer/pkg/readers/aggregator_reader.go | Extends constructor signature to accept resilience config and wires aggregator-specific handlers. |
| indexer/pkg/config/config.go | Adds Resilience and ResilienceConfig to the indexer configuration model. |
| indexer/config.example.toml | Documents the new [Resilience] TOML block and its default values. |
| indexer/cmd/replay/main.go | Passes configured resilience settings into reader creation in replay mode. |
| indexer/cmd/main.go | Passes configured resilience settings into reader creation in normal indexer mode. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
We encountered rate limiting issue value of the resilient reader, and it's never configurable, it always using this hardcoded default value.