We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cc7801b + d43eb77 commit 22fde3cCopy full SHA for 22fde3c
ss/pebbledb/db.go
@@ -177,11 +177,14 @@ func (db *Database) GetLatestVersion() (int64, error) {
177
}
178
179
func (db *Database) SetEarliestVersion(version int64) error {
180
- db.earliestVersion = version
+ if version > db.earliestVersion {
181
+ db.earliestVersion = version
182
- var ts [VersionSize]byte
183
- binary.LittleEndian.PutUint64(ts[:], uint64(version))
184
- return db.storage.Set([]byte(earliestVersionKey), ts[:], defaultWriteOpts)
+ var ts [VersionSize]byte
+ binary.LittleEndian.PutUint64(ts[:], uint64(version))
185
+ return db.storage.Set([]byte(earliestVersionKey), ts[:], defaultWriteOpts)
186
+ }
187
+ return nil
188
189
190
func (db *Database) GetEarliestVersion() (int64, error) {
0 commit comments