Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/logrepl/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (i *CDCIterator) NextN(ctx context.Context, n int) ([]opencdc.Record, error
return nil, fmt.Errorf("n must be greater than 0, got %d", n)
}

recs := make([]opencdc.Record, 0, n)
var recs []opencdc.Record

// Block until at least one record is received or context is canceled
select {
Expand Down
2 changes: 1 addition & 1 deletion source/logrepl/cdc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func TestCDCIterator_NextN(t *testing.T) {
}

// Will keep calling NextN until all records are received
var records []opencdc.Record
records := make([]opencdc.Record, 0, 2)
for len(records) < 2 {
recordsTmp, err := i.NextN(ctx, 5)
is.NoErr(err)
Expand Down
2 changes: 1 addition & 1 deletion source/logrepl/combined.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (c *CombinedIterator) NextN(ctx context.Context, n int) ([]opencdc.Record,
}

sdk.Logger(ctx).Debug().Msg("Snapshot completed, switching to CDC mode")
return c.activeIterator.NextN(ctx, n)
return c.NextN(ctx, n)
}
return records, nil
}
Expand Down
2 changes: 1 addition & 1 deletion source/logrepl/combined_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestCombinedIterator_NextN(t *testing.T) {
is.NoErr(err)

// Request 2 records in CDC mode
var records []opencdc.Record
records := make([]opencdc.Record, 0, 2)
var retries int
maxRetries := 10
for retries < maxRetries {
Expand Down