retract v4.3.0 due to #2121 and #2113, upgrade to Go v1.23, use ristretto v2 (#2122)

Fixes #2121
This commit is contained in:
Aman Mangal
2024-10-25 22:03:34 +05:30
committed by GitHub
parent a29533f723
commit 3220a35a10
39 changed files with 50 additions and 94 deletions
+1 -1
View File
@@ -1 +1 @@
1.19
1.23
+1 -1
View File
@@ -62,7 +62,7 @@ For more details on our version naming schema please read [Choosing a version](#
## Getting Started
### Installing
To start using Badger, install Go 1.19 or above. Badger v3 and above needs go modules. From your project, run the following command
To start using Badger, install Go 1.23 or above. Badger v3 and above needs go modules. From your project, run the following command
```sh
$ go get github.com/dgraph-io/badger/v4
-49
View File
@@ -1,49 +0,0 @@
# version format
version: "{build}"
# Operating system (build VM template)
os: Windows Server 2012 R2
# Platform.
platform: x64
clone_folder: c:\gopath\src\github.com\dgraph-io\badger
# Environment variables
environment:
GOVERSION: 1.19
GOPATH: c:\gopath
GO111MODULE: on
# scripts that run after cloning repository
install:
- set PATH=%GOPATH%\bin;c:\go\bin;c:\msys64\mingw64\bin;%PATH%
- go version
- go env
- python --version
- gcc --version
# To run your custom scripts instead of automatic MSBuild
build_script:
# We need to disable firewall - https://github.com/appveyor/ci/issues/1579#issuecomment-309830648
- ps: Disable-NetFirewallRule -DisplayName 'File and Printer Sharing (SMB-Out)'
- cd c:\gopath\src\github.com\dgraph-io\badger
- git branch
- go get -t ./...
# To run your custom scripts instead of automatic tests
test_script:
# Unit tests
- ps: Add-AppveyorTest "Unit Tests" -Outcome Running
- go test -v github.com/dgraph-io/badger/...
- ps: Update-AppveyorTest "Unit Tests" -Outcome Passed
notifications:
- provider: Email
to:
- pawan@dgraph.io
on_build_failure: true
on_build_status_changed: true
# to disable deployment
deploy: off
+1 -1
View File
@@ -28,7 +28,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// flushThreshold determines when a buffer will be flushed. When performing a
+1 -1
View File
@@ -36,7 +36,7 @@ import (
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
var testCmd = &cobra.Command{
+1 -1
View File
@@ -31,7 +31,7 @@ import (
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
var readBenchCmd = &cobra.Command{
+1 -1
View File
@@ -36,7 +36,7 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
var writeBenchCmd = &cobra.Command{
+1 -1
View File
@@ -26,7 +26,7 @@ import (
"go.opencensus.io/zpages"
"github.com/dgraph-io/badger/v4/badger/cmd"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func main() {
+1 -1
View File
@@ -24,7 +24,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// WriteBatch holds the necessary info to perform batched writes.
+2 -2
View File
@@ -41,8 +41,8 @@ import (
"github.com/dgraph-io/badger/v4/skl"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2"
"github.com/dgraph-io/ristretto/v2/z"
)
var (
+1 -1
View File
@@ -39,7 +39,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func TestTruncateVlogWithClose(t *testing.T) {
+1 -1
View File
@@ -37,7 +37,7 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// waitForMessage(ch, expected, count, timeout, t) will block until either
+1 -1
View File
@@ -24,7 +24,7 @@ import (
"sync"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// discardStats keeps track of the amount of data that could be discarded for
+4 -4
View File
@@ -1,11 +1,11 @@
+++
title = "Get Started - Quickstart Guide"
aliases = ["/get-started"]
+++
title = "Get Started - Quickstart Guide"
aliases = ["/get-started"]
+++
## Installing
To start using Badger, install Go 1.19 or above. Run the following command to retrieve the library.
To start using Badger, install Go 1.23 or above. Run the following command to retrieve the library.
```sh
$ go get github.com/dgraph-io/badger/v4
+4 -2
View File
@@ -1,10 +1,10 @@
module github.com/dgraph-io/badger/v4
go 1.19
go 1.23
require (
github.com/cespare/xxhash/v2 v2.3.0
github.com/dgraph-io/ristretto v1.0.0
github.com/dgraph-io/ristretto/v2 v2.0.0-alpha
github.com/dustin/go-humanize v1.0.1
github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.4
@@ -31,3 +31,5 @@ require (
)
retract v4.0.0 // see #1888 and #1889
retract v4.3.0 // see #2113 and #2121
+5 -2
View File
@@ -9,9 +9,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgraph-io/ristretto v1.0.0 h1:SYG07bONKMlFDUYu5pEu3DGAh8c2OFNzKm6G9J4Si84=
github.com/dgraph-io/ristretto v1.0.0/go.mod h1:jTi2FiYEhQ1NsMmA7DeBykizjOuY88NhKBkepyu1jPc=
github.com/dgraph-io/ristretto/v2 v2.0.0-alpha h1:JBy5Mm/z1HBj3hyDLFBS2uHalL971q3yjUaKcia0Sgo=
github.com/dgraph-io/ristretto/v2 v2.0.0-alpha/go.mod h1:7bFGBdXzLfFFjKCN8YDQ7+98m/AEYcrdqH7s0En96Qg=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -44,6 +45,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
@@ -108,6 +110,7 @@ golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
var maxValue int64 = 10000000
+1 -1
View File
@@ -27,7 +27,7 @@ import (
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
type prefetchStatus uint8
+1 -1
View File
@@ -37,7 +37,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
type levelsController struct {
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func val(large bool) []byte {
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/skl"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// memTable structure stores a skiplist and a corresponding WAL. Writes to memTable are written
+1 -1
View File
@@ -22,7 +22,7 @@ import (
"time"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// MergeOperator represents a Badger merge operator.
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// Note: If you add a new option X make sure you also add a WithX method on Options.
+1 -1
View File
@@ -23,7 +23,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/trie"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
type subscriber struct {
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"unsafe"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
const (
+1 -1
View File
@@ -28,7 +28,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
const batchSize = 16 << 20 // 16 MB
+1 -1
View File
@@ -30,7 +30,7 @@ import (
bpb "github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func keyWithPrefix(prefix string, k int) []byte {
+1 -1
View File
@@ -27,7 +27,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// StreamWriter is used to write data coming from multiple streams. The streams must not have any
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func getSortedKVList(valueSize, listSize int) *z.Buffer {
+1 -1
View File
@@ -33,7 +33,7 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
const (
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/v2"
)
func TestTableIndex(t *testing.T) {
+2 -2
View File
@@ -40,8 +40,8 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2"
"github.com/dgraph-io/ristretto/v2/z"
)
const fileSuffix = ".sst"
+1 -1
View File
@@ -34,7 +34,7 @@ import (
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/v2"
)
func key(prefix string, i int) string {
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/pkg/errors"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
type oracle struct {
+1 -1
View File
@@ -29,7 +29,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func TestTxnSimple(t *testing.T) {
+1 -1
View File
@@ -36,7 +36,7 @@ import (
otrace "go.opencensus.io/trace"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
// maxVlogFileSize is the maximum size of the vlog file which can be created. Vlog Offset is of
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"context"
"sync/atomic"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
type uint64Heap []uint64
+1 -1
View File
@@ -32,7 +32,7 @@ import (
"unsafe"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
var (
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/ristretto/z"
"github.com/dgraph-io/ristretto/v2/z"
)
func BenchmarkBuffer(b *testing.B) {