graphprotocol / graphprotocol/graph-node

Make queries deterministic when using read replicas

Open
#4,326 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug determinism
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.