You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following trivial example, I attempt to get a WAL iterator on a database using the latest sequence number.
package main
import (
log "github.com/sirupsen/logrus"
"github.com/tecbot/gorocksdb"
)
func main() {
opts := gorocksdb.NewDefaultOptions()
opts.SetCreateIfMissing(true)
testDB, err := gorocksdb.OpenDb(opts, "test")
if err != nil {
log.WithFields(log.Fields{
"error": err.Error(),
}).Error("error opening database")
return
}
lastSequence := testDB.GetLatestSequenceNumber()
walIter, err := testDB.GetUpdatesSince(lastSequence)
if err != nil {
log.WithFields(log.Fields{
"error": err.Error(),
"sequence": lastSequence,
}).Error("error getting WAL iterator")
return
}
if walIter == nil {
log.WithFields(log.Fields{
"sequence": lastSequence,
}).Error("WAL iterator is nil")
return
}
if walIter.Err() != nil {
log.WithFields(log.Fields{
"error": walIter.Err(),
"sequence": lastSequence,
}).Error("WAL iterator has an error")
return
}
if !walIter.Valid() {
log.WithFields(log.Fields{
"sequence": lastSequence,
}).Error("WAL iterator is not valid")
return
}
}
Running this code produces the following:
ERRO[0000] WAL iterator is not valid sequence=0
I've also done more complex examples, where I've loaded some data and the sequence is not 0, but I still get an invalid iterator.
Unless I'm missing something, this seems like a bug in gorocksdb, or rocksdb itself? I'm using arch to install rocksdb, which brought down version 6.5.3-1. Gorocksdb built just fine, but based on this I'm thinking maybe it's a version issue. I'll try to build on an 5.X version and see what happens (though it would be great to be on >= 6.2.2 so I don't have to backport the fix for the memory leak).
The text was updated successfully, but these errors were encountered:
In the following trivial example, I attempt to get a WAL iterator on a database using the latest sequence number.
Running this code produces the following:
I've also done more complex examples, where I've loaded some data and the sequence is not 0, but I still get an invalid iterator.
Unless I'm missing something, this seems like a bug in gorocksdb, or rocksdb itself? I'm using arch to install rocksdb, which brought down version 6.5.3-1. Gorocksdb built just fine, but based on this I'm thinking maybe it's a version issue. I'll try to build on an 5.X version and see what happens (though it would be great to be on >= 6.2.2 so I don't have to backport the fix for the memory leak).
The text was updated successfully, but these errors were encountered: