track retries correctly in truncation case

This commit is contained in:
Seebs 2020-05-12 15:38:11 -05:00 committed by Jaden Weiss
parent 176d49e4b5
commit 2826ecc0b7
No known key found for this signature in database
GPG key ID: 177F065773634B67

View file

@ -333,6 +333,7 @@ func newGeneration(existing generation, path string, readData bool, setup func([
m := mmapGeneration{path: path, logger: logger}
if existing != nil {
m.generation = existing.Generation() + 1
m.retries = existing.(*mmapGeneration).retries
// we might keep a previous generation around just for its generation count.
if !existing.Dead() {
defer existing.Done()