• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dgraph-io / badger / 3396 / 1
61%
main: 61%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions-eb8e6b6abe
DEFAULT BRANCH: main
Ran 06 Dec 2019 10:38AM UTC
Files 41
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Dec 2019 10:26AM UTC coverage: 77.502% (-0.1%) from 77.619%
3396.1

push

travis-ci

web-flow
<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">&quot;&gt;Fix windows dataloss issue (#1134)

Windows doesn&amp;#39;t allow memory mapping a file to a size greater than the
file&amp;#39;s actual size. To circumvent this, we increase the file size by
truncating it.
https://github.com/dgraph-io/badger/blob/&lt;/a&gt;&lt;a class=&quot;double-link&quot; href=&quot;https://github.com/dgraph-io/badger/commit/&lt;a class=&quot;double-link&quot; href=&quot;https://git">&lt;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 &quot;truncated&quot; 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&#39;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>

6659 of 8592 relevant lines covered (77.5%)

79314.22 hits per line

Source Files on job 3396.1
  • Tree
  • List 0
  • Changed 26
  • Source Changed 1
  • Coverage Changed 26
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2887
  • Travis Job 3396.1
  • 969a8e86 on github
  • Prev Job for on master (#3395.1)
  • Next Job for on master (#3397.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc