From f3f5c7f472a4f87d2e393c4b27d794243589231e Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 22 May 2018 15:53:33 +0400 Subject: [PATCH] we must only return io.EOF to progress to the next file in auto.Group since we never write msg partially, if we've encountered io.EOF in the middle of the msg, we must abort --- consensus/wal.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/consensus/wal.go b/consensus/wal.go index 1abf97293..c00fec614 100644 --- a/consensus/wal.go +++ b/consensus/wal.go @@ -273,9 +273,6 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) { b = make([]byte, 4) _, err = dec.rd.Read(b) - if err == io.EOF { - return nil, err - } if err != nil { return nil, fmt.Errorf("failed to read length: %v", err) } @@ -287,9 +284,6 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) { data := make([]byte, length) _, err = dec.rd.Read(data) - if err == io.EOF { - return nil, err - } if err != nil { return nil, fmt.Errorf("failed to read data: %v", err) }