Skip to content

Commit

Permalink
Add comment about new options
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Nov 13, 2024
1 parent ea05ef4 commit 71adf32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/mysql/binlog_event_compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ func (dp *decoderPool) Get(reader io.Reader) (*zstd.Decoder, error) {
return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "[BUG] expected *zstd.Decoder but got %T", pooled)
}
} else {
// Use the minimum amount of memory we can in processing the transaction by
// setting lowMem to true and limiting the window concurrency to 1 so that
// there's no async decoding of multiple windows or blocks.
d, err := zstd.NewReader(nil, zstd.WithDecoderLowmem(true), zstd.WithDecoderConcurrency(1))
if err != nil { // Should only happen e.g. due to ENOMEM
return nil, vterrors.Wrap(err, "failed to create stateful stream decoder")
Expand Down

0 comments on commit 71adf32

Please sign in to comment.