1
0
Fork 0

Don't close the Scanner until Bytes is done

master
Philip O'Toole 8 months ago
parent 3f15a89a1d
commit c5d549ae56

@ -1949,11 +1949,12 @@ func (s *Store) fsmSnapshot() (fSnap raft.FSMSnapshot, retErr error) {
if err != nil {
return nil, err
}
walFD.Close() // We need it closed for the next step.
compactedBytes, err := scanner.Bytes()
if err != nil {
return nil, err
}
walFD.Close() // We need it closed for the next step.
stats.Get(snapshotCreateWALCompactDuration).(*expvar.Int).Set(time.Since(compactStartTime).Milliseconds())
compactedBuf = bytes.NewBuffer(compactedBytes)

Loading…
Cancel
Save