|
Ran
|
Files
41
|
Run time
3s
|
Badge
README BADGES
|
push
travis-ci
<a href="https://github.com/dgraph-io/badger/commit/<a class=hub.com/dgraph-io/badger/commit/969a8e86294e164180aabd630313a06b97827081">969a8e862<a href="https://github.com/dgraph-io/badger/commit/969a8e86294e164180aabd630313a06b97827081">">Fix windows dataloss issue (#1134) Windows doesn&#39;t allow memory mapping a file to a size greater than the file&#39;s actual size. To circumvent this, we increase the file size by truncating it. https://github.com/dgraph-io/badger/blob/</a><a class="double-link" href="https://github.com/dgraph-io/badger/commit/<a class="double-link" href="https://git"><a class=</a>hub.com/dgraph-io/badger/commit/<a class=hub.com/dgraph-io/badger/commit/f5b63211d7f3e2f5f8b698893313b2a54e4df7de">f5b63211d">f5b63211d</a><a href="https://github.com/dgraph-io/badger/commit/969a8e86294e164180aabd630313a06b97827081">/y/mmap_windows.go#L41-L48 When badger would re-open, we try to replay this "truncated" file. Since this truncated file consists of all zeros, the replay would return the last offset as `zero` and then we would truncate the original file to size `zero`. The replay function would return `zero` as the last valid offset which was wrong. The last valid offset is start offset plus the forward movements of the file offset. So instead of https://github.com/dgraph-io/badger/blob/f5b63211d7f3e2f5f8b698893313b2a54e4df7de/value.go#L433 ```go var validEndOff uint32 // notice we're starting from zero, not the start point. ``` we should be doing ```go var validEndOff uint32 = offset ``` Fixes - https://github.com/dgraph-io/badger/issues/1126</a>
6658 of 8587 relevant lines covered (77.54%)
77499.33 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|