vendor: go.etcd.io/bbolt v1.3.9

full diff: https://github.com/etcd-io/bbolt/compare/v1.3.8...v1.3.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-02-27 15:12:15 +01:00
parent c9c8346bfa
commit 154ed26a77
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 23 additions and 15 deletions

2
go.mod
View File

@ -56,7 +56,7 @@ require (
github.com/tchap/go-patricia/v2 v2.3.1 github.com/tchap/go-patricia/v2 v2.3.1
github.com/urfave/cli/v2 v2.27.1 github.com/urfave/cli/v2 v2.27.1
github.com/vishvananda/netlink v1.2.1-beta.2 github.com/vishvananda/netlink v1.2.1-beta.2
go.etcd.io/bbolt v1.3.8 go.etcd.io/bbolt v1.3.9
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0
go.opentelemetry.io/otel v1.23.1 go.opentelemetry.io/otel v1.23.1

4
go.sum
View File

@ -421,8 +421,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=

30
vendor/go.etcd.io/bbolt/bucket.go generated vendored
View File

@ -162,12 +162,17 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
return nil, ErrBucketNameRequired return nil, ErrBucketNameRequired
} }
// Insert into node.
// Tip: Use a new variable `newKey` instead of reusing the existing `key` to prevent
// it from being marked as leaking, and accordingly cannot be allocated on stack.
newKey := cloneBytes(key)
// Move cursor to correct position. // Move cursor to correct position.
c := b.Cursor() c := b.Cursor()
k, _, flags := c.seek(key) k, _, flags := c.seek(newKey)
// Return an error if there is an existing key. // Return an error if there is an existing key.
if bytes.Equal(key, k) { if bytes.Equal(newKey, k) {
if (flags & bucketLeafFlag) != 0 { if (flags & bucketLeafFlag) != 0 {
return nil, ErrBucketExists return nil, ErrBucketExists
} }
@ -182,16 +187,14 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
} }
var value = bucket.write() var value = bucket.write()
// Insert into node. c.node().put(newKey, newKey, value, 0, bucketLeafFlag)
key = cloneBytes(key)
c.node().put(key, key, value, 0, bucketLeafFlag)
// Since subbuckets are not allowed on inline buckets, we need to // Since subbuckets are not allowed on inline buckets, we need to
// dereference the inline page, if it exists. This will cause the bucket // dereference the inline page, if it exists. This will cause the bucket
// to be treated as a regular, non-inline bucket for the rest of the tx. // to be treated as a regular, non-inline bucket for the rest of the tx.
b.page = nil b.page = nil
return b.Bucket(key), nil return b.Bucket(newKey), nil
} }
// CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it. // CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it.
@ -288,18 +291,23 @@ func (b *Bucket) Put(key []byte, value []byte) error {
return ErrValueTooLarge return ErrValueTooLarge
} }
// Insert into node.
// Tip: Use a new variable `newKey` instead of reusing the existing `key` to prevent
// it from being marked as leaking, and accordingly cannot be allocated on stack.
newKey := cloneBytes(key)
// Move cursor to correct position. // Move cursor to correct position.
c := b.Cursor() c := b.Cursor()
k, _, flags := c.seek(key) k, _, flags := c.seek(newKey)
// Return an error if there is an existing key with a bucket value. // Return an error if there is an existing key with a bucket value.
if bytes.Equal(key, k) && (flags&bucketLeafFlag) != 0 { if bytes.Equal(newKey, k) && (flags&bucketLeafFlag) != 0 {
return ErrIncompatibleValue return ErrIncompatibleValue
} }
// Insert into node. // gofail: var beforeBucketPut struct{}
key = cloneBytes(key)
c.node().put(key, key, value, 0, 0) c.node().put(newKey, newKey, value, 0, 0)
return nil return nil
} }

2
vendor/modules.txt vendored
View File

@ -402,7 +402,7 @@ github.com/vishvananda/netns
# github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 # github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673
## explicit ## explicit
github.com/xrash/smetrics github.com/xrash/smetrics
# go.etcd.io/bbolt v1.3.8 # go.etcd.io/bbolt v1.3.9
## explicit; go 1.17 ## explicit; go 1.17
go.etcd.io/bbolt go.etcd.io/bbolt
# go.opencensus.io v0.24.0 # go.opencensus.io v0.24.0