WAL ReadAll() truncates the file even upon transient I/O error

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go

調査の方向性

Read the WAL's ReadAll() method and the readRecord call shown in the issue. Trace how readRecord reports transient I/O errors versus CRC corruption, then check the WAL tests for coverage of both cases. Done means transient read errors cause the process to fail without truncating the file, while corrupted records retain their intended handling.

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

説明

In the WAL's ReadAll() method, we have the following code:

	var payloads [][]byte
	for bytesToRead > 0 {
		payload, bytesRead, err := readRecord(w.file, bytesToRead)
		// record was corrupted in wal
		if err != nil {
			return payloads, w.truncateAt(fileInfo.Size() - bytesToRead)
		}

readRecord reads a record and checks its CRC. The readRecord therefore can fail due to two reasons:

  1. A transient read error
  2. A corruption of the records inside the file.

The handling in ReadAll doesn't distinguish between the two, and truncates the file anyway.

We therefore need to crash upon a transient read error instead of truncating the file.

主要言語
Go
スター
22
フォーク
4
平均マージ
2日 4時間
マージ済み PR(30日)
43

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

ava-labs/Simplex のほかの issue

ava-labs/Simplex の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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