graphprotocol / graphprotocol/graph-node

[Bug] graphman truncate doesn't remove 300 GB of the old blocks from db

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

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

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

説明

Bug report

When using graphman chain truncate I still see over 2.5 million blocks in chain4.blocks table and 5.5 million in chain5.blocks inside postgres. They are taking around 300 GB of space. Why are they not removed? Can I remove them in any other way? I don't see a reason why they are kept there.

Relevant log output
graphDB=# SELECT
    table_schema || '.' || table_name AS "table_full_name",
    pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) AS "size"
FROM
    information_schema.tables
WHERE
    table_schema NOT IN ('pg_catalog', 'information_schema')
ORDER BY
    pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') DESC;
                 table_full_name                 |    size
-------------------------------------------------+------------
 chain4.blocks                                   | 167 GB
 chain5.blocks                                   | 146 GB


graphDB=# select count(*) from chain4.blocks;
  count
---------
 2627100

graphDB=# select count(*) from chain5.blocks;
  count
---------
 5482991

graphDB=# SELECT reltoastrelid::regclass AS toast_table_name,
       pg_size_pretty(pg_relation_size(reltoastrelid)) AS toast_table_size
FROM pg_class
WHERE relname = 'blocks';
     toast_table_name      | toast_table_size
---------------------------+------------------
 pg_toast.pg_toast_5695384 | 165 GB
 pg_toast.pg_toast_5695408 | 142 GB
 pg_toast.pg_toast_18030   | 105 MB
 pg_toast.pg_toast_18054   | 0 bytes
 pg_toast.pg_toast_2412454 | 5592 kB
IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out
  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
OS information

Linux

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

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

はじめの一歩

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

調査の方向性

このレポートは graphman chain truncate と、PostgreSQL の chain4.blocks および chain5.blocks テーブルを中心に扱います。まず、切り詰め処理を再現し、実行前後で報告されている行数、テーブルサイズ、TOAST サイズを確認してください。コマンドの動作が説明され、古いブロックが削除されるか、文書化されたクリーンアップ手順が特定されれば完了です。

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

評価

技術スタック
postgresql, rust
領域
cli, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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