Merge pull request #26337 from containers/renovate/go.etcd.io-bbolt-1.x

fix(deps): update module go.etcd.io/bbolt to v1.4.1
This commit is contained in:
openshift-merge-bot[bot]
2025-06-11 08:38:49 +00:00
committed by GitHub
34 changed files with 125 additions and 120 deletions

2
go.mod
View File

@ -68,7 +68,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/vbauerster/mpb/v8 v8.10.2
github.com/vishvananda/netlink v1.3.1
go.etcd.io/bbolt v1.4.0
go.etcd.io/bbolt v1.4.1
golang.org/x/crypto v0.39.0
golang.org/x/net v0.41.0
golang.org/x/sync v0.15.0

4
go.sum
View File

@ -501,8 +501,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk=
go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk=
go.etcd.io/bbolt v1.4.1 h1:5mOV+HWjIPLEAlUGMsveaUvK2+byZMFOzojoi7bh7uI=
go.etcd.io/bbolt v1.4.1/go.mod h1:c8zu2BnXWTu2XM4XcICtbGSl9cFwsXtcf9zLt2OncM8=
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=

View File

@ -1 +1 @@
1.23.6
1.23.9

View File

@ -1,7 +0,0 @@
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0x7FFFFFFF // 2GB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0xFFFFFFF

View File

@ -1,7 +0,0 @@
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,7 +0,0 @@
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0x7FFFFFFF // 2GB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0xFFFFFFF

View File

@ -1,9 +0,0 @@
//go:build arm64
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,9 +0,0 @@
//go:build loong64
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,9 +0,0 @@
//go:build mips64 || mips64le
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0x8000000000 // 512GB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,9 +0,0 @@
//go:build mips || mipsle
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0x40000000 // 1GB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0xFFFFFFF

View File

@ -1,9 +0,0 @@
//go:build ppc
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0x7FFFFFFF // 2GB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0xFFFFFFF

View File

@ -1,9 +0,0 @@
//go:build ppc64
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,9 +0,0 @@
//go:build ppc64le
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,9 +0,0 @@
//go:build riscv64
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -1,9 +0,0 @@
//go:build s390x
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF

View File

@ -11,6 +11,7 @@ import (
"golang.org/x/sys/unix"
"go.etcd.io/bbolt/errors"
"go.etcd.io/bbolt/internal/common"
)
// flock acquires an advisory lock on a file descriptor.
@ -67,7 +68,7 @@ func mmap(db *DB, sz int) error {
// Save the original byte slice and convert to a byte array pointer.
db.dataref = b
db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0]))
db.datasz = sz
return nil
}

View File

@ -10,6 +10,7 @@ import (
"golang.org/x/sys/windows"
"go.etcd.io/bbolt/errors"
"go.etcd.io/bbolt/internal/common"
)
// fdatasync flushes written data to a file descriptor.
@ -95,7 +96,7 @@ func mmap(db *DB, sz int) error {
}
// Convert to a byte array.
db.data = (*[maxMapSize]byte)(unsafe.Pointer(addr))
db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(addr))
db.datasz = sz
return nil

16
vendor/go.etcd.io/bbolt/db.go generated vendored
View File

@ -125,7 +125,7 @@ type DB struct {
// always fails on Windows platform.
//nolint
dataref []byte // mmap'ed readonly, write throws SEGV
data *[maxMapSize]byte
data *[common.MaxMapSize]byte
datasz int
meta0 *common.Meta
meta1 *common.Meta
@ -563,7 +563,7 @@ func (db *DB) mmapSize(size int) (int, error) {
}
// Verify the requested size is not above the maximum allowed.
if size > maxMapSize {
if size > common.MaxMapSize {
return 0, errors.New("mmap too large")
}
@ -581,8 +581,8 @@ func (db *DB) mmapSize(size int) (int, error) {
}
// If we've exceeded the max size then only grow up to the max size.
if sz > maxMapSize {
sz = maxMapSize
if sz > common.MaxMapSize {
sz = common.MaxMapSize
}
return int(sz), nil
@ -1080,7 +1080,7 @@ func safelyCall(fn func(*Tx) error, tx *Tx) (err error) {
// then it allows you to force the database file to sync against the disk.
func (db *DB) Sync() (err error) {
if lg := db.Logger(); lg != discardLogger {
lg.Debug("Syncing bbolt db (%s)", db.path)
lg.Debugf("Syncing bbolt db (%s)", db.path)
defer func() {
if err != nil {
lg.Errorf("[GOOS: %s, GOARCH: %s] syncing bbolt db (%s) failed: %v", runtime.GOOS, runtime.GOARCH, db.path, err)
@ -1309,6 +1309,12 @@ type Options struct {
// If <=0, the initial map size is 0.
// If initialMmapSize is smaller than the previous database size,
// it takes no effect.
//
// Note: On Windows, due to platform limitations, the database file size
// will be immediately resized to match `InitialMmapSize` (aligned to page size)
// when the DB is opened. On non-Windows platforms, the file size will grow
// dynamically based on the actual amount of written data, regardless of `InitialMmapSize`.
// Refer to https://github.com/etcd-io/bbolt/issues/378#issuecomment-1378121966.
InitialMmapSize int
// PageSize overrides the default OS page size.

7
vendor/go.etcd.io/bbolt/internal/common/bolt_386.go generated vendored Normal file
View File

@ -0,0 +1,7 @@
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0x7FFFFFFF // 2GB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0xFFFFFFF

View File

@ -0,0 +1,7 @@
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

7
vendor/go.etcd.io/bbolt/internal/common/bolt_arm.go generated vendored Normal file
View File

@ -0,0 +1,7 @@
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0x7FFFFFFF // 2GB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0xFFFFFFF

View File

@ -0,0 +1,9 @@
//go:build arm64
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -0,0 +1,9 @@
//go:build loong64
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -0,0 +1,9 @@
//go:build mips64 || mips64le
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0x8000000000 // 512GB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -0,0 +1,9 @@
//go:build mips || mipsle
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0x40000000 // 1GB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0xFFFFFFF

9
vendor/go.etcd.io/bbolt/internal/common/bolt_ppc.go generated vendored Normal file
View File

@ -0,0 +1,9 @@
//go:build ppc
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0x7FFFFFFF // 2GB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0xFFFFFFF

View File

@ -0,0 +1,9 @@
//go:build ppc64
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -0,0 +1,9 @@
//go:build ppc64le
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -0,0 +1,9 @@
//go:build riscv64
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -0,0 +1,9 @@
//go:build s390x
package common
// MaxMapSize represents the largest mmap size supported by Bolt.
const MaxMapSize = 0xFFFFFFFFFFFF // 256TB
// MaxAllocSize is the size used when creating array pointers.
const MaxAllocSize = 0x7FFFFFFF

View File

@ -17,9 +17,6 @@ const Magic uint32 = 0xED0CDAED
const PgidNoFreelist Pgid = 0xffffffffffffffff
// DO NOT EDIT. Copied from the "bolt" package.
const pageMaxAllocSize = 0xFFFFFFF
// IgnoreNoSync specifies whether the NoSync field of a DB is ignored when
// syncing changes to a file. This is required as some operating systems,
// such as OpenBSD, do not have a unified buffer cache (UBC) and writes

View File

@ -23,5 +23,5 @@ func UnsafeByteSlice(base unsafe.Pointer, offset uintptr, i, j int) []byte {
// index 0. However, the wiki never says that the address must be to
// the beginning of a C allocation (or even that malloc was used at
// all), so this is believed to be correct.
return (*[pageMaxAllocSize]byte)(UnsafeAdd(base, offset))[i:j:j]
return (*[MaxAllocSize]byte)(UnsafeAdd(base, offset))[i:j:j]
}

4
vendor/go.etcd.io/bbolt/tx.go generated vendored
View File

@ -495,8 +495,8 @@ func (tx *Tx) write() error {
// Write out page in "max allocation" sized chunks.
for {
sz := rem
if sz > maxAllocSize-1 {
sz = maxAllocSize - 1
if sz > common.MaxAllocSize-1 {
sz = common.MaxAllocSize - 1
}
buf := common.UnsafeByteSlice(unsafe.Pointer(p), written, 0, int(sz))

2
vendor/modules.txt vendored
View File

@ -1001,7 +1001,7 @@ github.com/vishvananda/netns
# github.com/yusufpapurcu/wmi v1.2.4
## explicit; go 1.16
github.com/yusufpapurcu/wmi
# go.etcd.io/bbolt v1.4.0
# go.etcd.io/bbolt v1.4.1
## explicit; go 1.23
go.etcd.io/bbolt
go.etcd.io/bbolt/errors