-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
area/apiIssues related to current API limitations.Issues related to current API limitations.kind/bugSomething is broken.Something is broken.priority/P2Somehow important but would not block a release.Somehow important but would not block a release.status/acceptedWe accept to investigate or work on it.We accept to investigate or work on it.
Description
What version of Go are you using (go version)?
$ go version go version go1.14.1 windows/amd64
What version of Badger are you using?
Does this issue reproduce with the latest master?
yes
What are the hardware specifications of the machine (RAM, OS, Disk)?
mem:32g
os:windows 10
disk:Samsung SSD 970 EVO Plus
What did you do?
package main
import (
"fmt"
"log"
"os"
"github.com/dgraph-io/badger"
)
func main() {
opts := badger.DefaultOptions("./tmp")
os.RemoveAll(opts.Dir)
os.MkdirAll(opts.Dir, 0700)
db, err := badger.Open(opts)
if err != nil {
log.Fatal(err)
}
defer db.Close()
key := []byte("key")
seq1, err := db.GetSequence(key, 2)
if err != nil {
panic(err)
}
seq2, err := db.GetSequence(key, 2)
if err != nil {
panic(err)
}
num, err := seq2.Next()
if err != nil {
panic(err)
}
fmt.Printf("num:%v\r\n", num)
err = seq2.Release()
if err != nil {
panic(err)
}
err = seq1.Release()
if err != nil {
panic(err)
}
seq3, err := db.GetSequence(key, 2)
if err != nil {
panic(err)
}
for i := 0; i < 5; i++ {
num, err := seq3.Next()
if err != nil {
panic(err)
}
fmt.Printf("num:%v\r\n", num)
}
seq3.Release()
}What did you expect to see?
Unique numbers
What did you see instead?
num:2
num:0
num:1
num:2
num:3
num:4
Metadata
Metadata
Assignees
Labels
area/apiIssues related to current API limitations.Issues related to current API limitations.kind/bugSomething is broken.Something is broken.priority/P2Somehow important but would not block a release.Somehow important but would not block a release.status/acceptedWe accept to investigate or work on it.We accept to investigate or work on it.