Skip to content

Commit

Permalink
fix: panic when prepare write failed
Browse files Browse the repository at this point in the history
  • Loading branch information
lzf575 committed Nov 20, 2024
1 parent b5ba3ff commit 3837e76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/ingester/pkg/ckwriter/ckwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ func (c *Cache) Write() error {
if c.batchSize == 0 {
return nil
}
var err error
conn := c.conns[c.writeCounter%c.connCount]
c.batch, err = conn.PrepareReuseBatch(context.Background(), c.prepare, c.batch)
batch, err := conn.PrepareReuseBatch(context.Background(), c.prepare, c.batch)
if err != nil {
return fmt.Errorf("prepare reuse batch item write block failed: %s", err)
}
c.batch = batch

err = c.batch.Send()
c.batch.Reset()
Expand Down

0 comments on commit 3837e76

Please sign in to comment.