Skip to content

Commit

Permalink
TBS: Fix missing TTL after badger.ErrTxnTooBig (#12453) (#12461)
Browse files Browse the repository at this point in the history
Tail-based sampling: Fix a case where entry TTL was not set after encountering badger.TxnTooBig.

(cherry picked from commit 6eb7375)

Co-authored-by: Carson Ip <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mergify[bot] and carsonip authored Jan 18, 2024
1 parent a5f3468 commit c803648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/apm-server/sampling/eventstorage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (rw *ReadWriter) writeEntry(e *badger.Entry, opts WriterOpts) error {
}
rw.pendingSize += entrySize
rw.s.pendingSize.Add(entrySize)
return rw.txn.SetEntry(e)
return rw.txn.SetEntry(e.WithTTL(opts.TTL))
}

func estimateSize(e *badger.Entry) int64 {
Expand Down

0 comments on commit c803648

Please sign in to comment.