mrproliu commented on code in PR #1154:
URL:
https://github.com/apache/skywalking-banyandb/pull/1154#discussion_r3354198392
##########
banyand/backup/lifecycle/row_replay_trace.go:
##########
@@ -141,40 +112,8 @@ func (r *traceRowReplayer) replayPart(ctx context.Context,
partPath string) (int
it := reader.Iterator()
defer it.Close()
-
- rowCount := 0
- for it.Next() {
- row := it.Row()
- if rowErr := r.publishRow(ctx, row); rowErr != nil {
- pos := it.Position()
- r.logger.Warn().Err(rowErr).
- Str("group", r.group).
- Str("trace", r.traceName).
- Str("part", partPath).
- Int("block_idx", pos.BlockIdx).
- Int("row_idx", pos.RowIdx).
- Int("rows_published", rowCount).
- Msg("trace row-replay aborted mid-part on
publish error; will retry on resume")
- return rowCount, rowErr
- }
- rowCount++
- }
- if iterErr := it.Err(); iterErr != nil {
- pos := it.Position()
- r.logger.Warn().Err(iterErr).
- Str("group", r.group).
- Str("trace", r.traceName).
- Str("part", partPath).
- Int("block_idx", pos.BlockIdx).
- Int("row_idx", pos.RowIdx).
- Int("rows_published", rowCount).
- Msg("trace row-replay aborted mid-part; will retry on
resume")
- return rowCount, iterErr
- }
- if r.counter != nil {
- atomic.AddUint64(r.counter, 1)
- }
- return rowCount, nil
+ return r.sender.replay(ctx, r.logger, r.group, partPath, r.counter, it,
Review Comment:
done
##########
banyand/backup/lifecycle/row_replay_test.go:
##########
@@ -24,15 +24,18 @@ import (
gofs "io/fs"
"path/filepath"
"strconv"
+ "sync/atomic"
"testing"
"time"
"github.com/onsi/gomega"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ gomock "go.uber.org/mock/gomock"
Review Comment:
dont
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]