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

Đang mở
#685 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
distributed-systems

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
22
Fork
4
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ava-labs/Simplex

Tất cả issue của ava-labs/Simplex

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.