0

Update deps

This commit is contained in:
eleksir
2024-08-03 20:52:54 +03:00
parent 4559d25902
commit 337a6a8925
229 changed files with 16261 additions and 7169 deletions

View File

@@ -5,6 +5,7 @@
package sstable
import (
"github.com/cockroachdb/fifo"
"github.com/cockroachdb/pebble/internal/base"
"github.com/cockroachdb/pebble/internal/cache"
)
@@ -111,6 +112,11 @@ type ReaderOptions struct {
// The default cache size is a zero-size cache.
Cache *cache.Cache
// LoadBlockSema, if set, is used to limit the number of blocks that can be
// loaded (i.e. read from the filesystem) in parallel. Each load acquires one
// unit from the semaphore for the duration of the read.
LoadBlockSema *fifo.Semaphore
// User properties specified in this map will not be added to sst.Properties.UserProperties.
DeniedUserProperties map[string]struct{}

View File

@@ -539,6 +539,15 @@ func (r *Reader) readBlock(
}
// Cache miss.
if sema := r.opts.LoadBlockSema; sema != nil {
if err := sema.Acquire(ctx, 1); err != nil {
// An error here can only come from the context.
return bufferHandle{}, err
}
defer sema.Release(1)
}
var compressed cacheValueOrBuf
if bufferPool != nil {
compressed = cacheValueOrBuf{
@@ -571,6 +580,7 @@ func (r *Reader) readBlock(
int(bh.Length+blockTrailerLen), readDuration.String())
}
if stats != nil {
stats.BlockBytes += bh.Length
stats.BlockReadDuration += readDuration
}
if err != nil {
@@ -628,9 +638,6 @@ func (r *Reader) readBlock(
decompressed = transformed
}
if stats != nil {
stats.BlockBytes += bh.Length
}
if decompressed.buf.Valid() {
return bufferHandle{b: decompressed.buf}, nil
}

View File

@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/cockroachdb/pebble/internal/base"
"github.com/cockroachdb/pebble/objstorage/objstorageprovider"
"github.com/cockroachdb/pebble/objstorage/objstorageprovider/objiotracing"
)
@@ -177,7 +178,7 @@ func (i *twoLevelIterator) init(
_ = i.topLevelIndex.Close()
return err
}
i.dataRH = r.readable.NewReadHandle(ctx)
i.dataRH = objstorageprovider.UsePreallocatedReadHandle(ctx, r.readable, &i.dataRHPrealloc)
if r.tableFormat >= TableFormatPebblev3 {
if r.Properties.NumValueBlocks > 0 {
i.vbReader = &valueBlockReader{