Skip to content

Commit

Permalink
fix segment path
Browse files Browse the repository at this point in the history
  • Loading branch information
hghaf099 committed Nov 8, 2023
1 parent af6cc18 commit 2a3ecf0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -382,12 +383,10 @@ func (w *WAL) GetSealedLogFiles(fromIndex uint64) ([]*SealedSegmentInfo, error)
for !it.Done() {
_, seg, ok := it.Prev()
if !ok {
fmt.Println("break ", seg.BaseIndex, seg.MaxIndex, seg.IndexStart)
break
}
// if the segment sealTime is zero, it means that the segment has not been sealed yet
if seg.SealTime.IsZero() {
fmt.Println("Continue....segment unseal", seg.BaseIndex, seg.MinIndex)
continue
}

Expand All @@ -396,7 +395,7 @@ func (w *WAL) GetSealedLogFiles(fromIndex uint64) ([]*SealedSegmentInfo, error)
// target index also include that.
if ok && seg.MinIndex >= fromIndex || seg.MaxIndex >= fromIndex {
sealedSegInfo = append(sealedSegInfo, &SealedSegmentInfo{
Path: seg.FileName(),
Path: filepath.Join(w.dir, seg.FileName()),
MinIndex: seg.MinIndex,
LogCount: (seg.MaxIndex - seg.MinIndex) + 1, // including the maxIndex
})
Expand Down

0 comments on commit 2a3ecf0

Please sign in to comment.