graphprotocol / graphprotocol/graph-node

Avoid 'canceling statement due to conflict with recovery'

オープン
#4,327 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Stale
主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

説明

When graph-node uses a shard with read replicas, replication conflicts can lead to an error canceling statement due to conflict with recovery. With that error, it is generally ok to retry the query, possibly with some backoff. The retry logic should guard against queries though that take so long that they are virtually guaranteed to fail with that error. For example, a query that would take 2 minutes will almost certainly fail if the underlying deployment has a decent amount of updates.

One way to avoid this would be to retry the query not against the same replica, but against the main database, where this error cannot happen.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

graph-node のシャードの読み取りレプリカにおけるクエリとリトライの経路を追跡し、その後、PostgreSQL のリカバリ競合エラーがどのように処理されているかを調査します。別のレプリカでリトライする方法と、クエリをメインデータベースにルーティングする方法を比較し、長時間実行されるクエリを考慮します。競合をリトライでき、レプリカに不適切なクエリを繰り返し送信しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
postgresql, rust
領域
backend, databases
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。