Skip to content

Commit

Permalink
test(ragdoll-wal): 补充单segment文件中blcokIdx达到wal blockIdx上限时开始循环测试case
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinoooo committed Feb 18, 2024
1 parent aae4a5f commit 74aa252
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion storage/core/ragdoll/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func (wal *Log) loadSegments() error {
err = activeSegment.open(wal.opts.dataPerm)
if err != nil {
// todo:调研 损坏恢复
if errors.Is(err, errs.NewCorruptErr()) {
if errs.GetCode(err) == errs.CorruptErrCode {
wal.corrupted = true
}
return err
Expand Down
5 changes: 5 additions & 0 deletions storage/core/ragdoll/wal/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ func TestLog_Corrupt(t *testing.T) {

// TestLog_Sync 同步磁盘
func TestLog_Sync(t *testing.T) {
_, err := os.Create("../../../../test_data/wal/20000000.active")
if err != nil {
t.Error(err)
}

segmentSize := 100 * consts.MB
opts := NewOptions().
SetSegmentCapacity(int64(segmentSize))
Expand Down

0 comments on commit 74aa252

Please sign in to comment.