graphprotocol / graphprotocol/graph-node
Make queries deterministic when using read replicas
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
When graph-node uses a shard that has asynchronous read replicas, query results are not deterministic because the read replicas can trail behind the main database, usually up to 30s.
When we execute a GraphQL query, we determine the block at which to execute by looking at the main database; fetching the data for the query result might be done against one of the read replicas which can lag behind the main database, and so even though we claim that the query was executed against block 100, the data that we use for the result might only be up to block 99.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing GraphQL query execution from block selection on the main database through shard and read-replica fetching. Reproduce the case where a replica trails the selected block by one or more blocks, then define and test behavior that keeps the reported block and returned data consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, rust
- Domain
- backend-api-design, databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100