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

dgraph-io / badger / 1930 / 4
61%
main: 61%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions-eb8e6b6abe
DEFAULT BRANCH: main
Ran 02 May 2019 02:36PM UTC
Files 31
Run time 3s
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

02 May 2019 02:25PM UTC coverage: 79.144% (+0.04%) from 79.103%
1930.4

push

travis-ci

jarifibrahim
<a href="https://github.com/dgraph-io/badger/commit/<a class=hub.com/dgraph-io/badger/commit/6b796b3ebec3ff006fcb1b425836cd784651e9fd">6b796b3eb<a href="https://github.com/dgraph-io/badger/commit/6b796b3ebec3ff006fcb1b425836cd784651e9fd">&quot;&gt;Set readTs in write batch to latest done readTs so that we can discard older versions of keys during compactions.

Every Transaction stores the latest value of `readTs` it is aware of. When the transaction is discarded (which happens even when we commit), the global value of `readMark` is updated.
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/&amp;lt;a class=&amp;quot;double-link&amp;quot; href=&amp;quot;https://git&quot;&gt;&amp;lt;a class=</a>hub.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/<a class="double-link" href="https://git"><a class=hub.com/dgraph-io/badger/commit/1fcc96ecdb66d221df85cddec186b6ac7b6dab4b">1fcc96ecd">1fcc96ecd</a><a href="https://github.com/dgraph-io/badger/commit/6b796b3ebec3ff006fcb1b425836cd784651e9fd">/txn.go#L501-L503
Previously, the `readTs` of transaction inside the write batch struct was set to 0. So the global value of `readMark` would also be set to 0 (unless someone ran a transaction after using write batch).
Due to the 0 value of the global `readMark`, the compaction algorithm would skip all the values which were inserted in the write batch call.
See https://github.com/dgraph-io/badger/blob/1fcc96ecdb66d221df85cddec186b6ac7b6dab4b/levels.go#L480-L484
and
https://github.com/dgraph-io/badger/blob/1fcc96ecdb66d221df85cddec186b6ac7b6dab4b/txn.go#L138-L145
The `o.readMark.DoneUntil()` call would always return `0` and so the compaction wouldn&#39;t compact the newer values.

With this commit, the compaction algorithm works as expected with key-values inserted via Transaction API or via the Write Batch API.

See https://github.com/dgraph-io/badger/issues/767</a>

5123 of 6473 relevant lines covered (79.14%)

579562.97 hits per line

Source Files on job 1930.4
  • Tree
  • List 0
  • Changed 18
  • Source Changed 1
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1776
  • Travis Job 1930.4
  • 6b796b3e on github
  • Prev Job for on master (#1929.2)
  • Next Job for on master (#1937.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