Skip to content

Commit

Permalink
Add epoch info to watch merger
Browse files Browse the repository at this point in the history
Signed-off-by: Gao Hongtao <[email protected]>
  • Loading branch information
hanahmily committed Sep 13, 2024
1 parent b5aa1c7 commit 7592db5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions banyand/measure/merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (tst *tsTable) mergeLoop(merges chan *mergerIntroduction, flusherNotifier w
return false
}
defer curSnapshot.decRef()
tst.l.Logger.Warn().Msgf("mergeLoop: cur %d merge %d", curSnapshot.epoch, epoch)
if curSnapshot.epoch != epoch {
tst.incTotalMergeLoopStarted(1)
defer tst.incTotalMergeLoopFinished(1)
Expand Down
6 changes: 3 additions & 3 deletions banyand/measure/tstable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ func Test_tstIter(t *testing.T) {
snp.decRef()
break OUTER
}
t.Logf("waiting for snapshot %d to be flushed or merged: current creator:%d, parts: %+v",
i, snp.creator, snp.parts)
t.Logf("waiting for snapshot %d(%d) to be flushed or merged: current creator:%d, parts: %+v",
i, snp.creator, snp.epoch, snp.parts)
snp.decRef()
time.Sleep(100 * time.Millisecond)
}
Expand All @@ -367,7 +367,7 @@ func Test_tstIter(t *testing.T) {
snp.decRef()
break OUTER1
}
t.Logf("waiting for snapshot to be merged: current creator:%d, parts: %+v", snp.creator, snp.parts)
t.Logf("waiting for snapshot to be merged: current creator:%d(%d), parts: %+v", snp.creator, snp.epoch, snp.parts)
snp.decRef()
time.Sleep(100 * time.Millisecond)
}
Expand Down
1 change: 1 addition & 0 deletions banyand/stream/merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (tst *tsTable) mergeLoop(merges chan *mergerIntroduction, flusherNotifier w
return false
}
defer curSnapshot.decRef()
tst.l.Logger.Warn().Msgf("mergeLoop: cur %d merge %d", curSnapshot.epoch, epoch)
if curSnapshot.epoch != epoch {
tst.incTotalMergeLoopStarted(1)
defer tst.incTotalMergeLoopFinished(1)
Expand Down
6 changes: 3 additions & 3 deletions banyand/stream/tstable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ func Test_tstIter(t *testing.T) {
snp.decRef()
break OUTER
}
t.Logf("waiting for snapshot %d to be flushed or merged: current creator:%d, parts: %+v",
i, snp.creator, snp.parts)
t.Logf("waiting for snapshot %d(%d) to be flushed or merged: current creator:%d, parts: %+v",
i, snp.creator, snp.epoch, snp.parts)
snp.decRef()
time.Sleep(100 * time.Millisecond)
}
Expand All @@ -353,7 +353,7 @@ func Test_tstIter(t *testing.T) {
snp.decRef()
break OUTER1
}
t.Logf("waiting for snapshot to be merged: current creator:%d, parts: %+v", snp.creator, snp.parts)
t.Logf("waiting for snapshot to be merged: current creator:%d(%d), parts: %+v", snp.creator, snp.epoch, snp.parts)
snp.decRef()
time.Sleep(100 * time.Millisecond)
}
Expand Down

0 comments on commit 7592db5

Please sign in to comment.