qa: Verify DBWrapper iterators are taking snapshots #11422

pull TheBlueMatt wants to merge 1 commits into bitcoin:master from TheBlueMatt:2017-09-leveldb-check-snapshots changing 1 files +14 −2
  1. TheBlueMatt commented at 9:36 PM on September 29, 2017: member

    The LevelDB docs seem to indicate that an iterator will not take snapshots (even providing instructions on how to do so yourself). In several of the places we use them, we assume snapshots to have been taken.

    In order to make sure LevelDB doesn't change out from under us (and to prevent the next person who reads the docs from having the same fright I did), verify that snapshots are taken in our tests.

  2. in src/test/dbwrapper_tests.cpp:207 in 517ec7260c outdated
     203 | @@ -204,19 +204,33 @@ BOOST_AUTO_TEST_CASE(iterator_ordering)
     204 |      for (int x=0x00; x<256; ++x) {
     205 |          uint8_t key = x;
     206 |          uint32_t value = x*x;
     207 | -        BOOST_CHECK(dbw.Write(key, value));
     208 | +        if (!(x & 1))
    


    sipa commented at 10:06 PM on September 29, 2017:

    Can I haz braces before indenting?


    TheBlueMatt commented at 6:18 PM on September 30, 2017:

    No, but I fixed it anyway :p.

  3. sipa commented at 10:08 PM on September 29, 2017: member

    utACK

  4. MarcoFalke renamed this:
    Verify DBWrapper iterators are taking snapshots
    qa: Verify DBWrapper iterators are taking snapshots
    on Sep 30, 2017
  5. MarcoFalke added the label Tests on Sep 30, 2017
  6. Verify DBWrapper iterators are taking snapshots
    The LevelDB docs seem to indicate that an iterator will not take
    snapshots (even providing instructions on how to do so yourself).
    In several of the places we use them, we assume snapshots to have
    been taken.
    
    In order to make sure LevelDB doesn't change out from under us
    (and to prevent the next person who reads the docs from having the
    same fright I did), verify that snapshots are taken in our tests.
    bb8376bbc3
  7. TheBlueMatt force-pushed on Sep 30, 2017
  8. laanwj commented at 12:40 PM on October 2, 2017: member

    Yes, iterators not changing under us is an important part of our leveldb usage. I remember in the past this was well-documented. I wonder when they changed the documentation to no longer say this, and what their plans here are?

    In any case it's good to check. utACK bb8376b

  9. laanwj merged this on Oct 2, 2017
  10. laanwj closed this on Oct 2, 2017

  11. laanwj referenced this in commit c641ccac5b on Oct 2, 2017
  12. MarcoFalke referenced this in commit 5ee275a1fb on Oct 3, 2017
  13. MarcoFalke referenced this in commit 974c4b418e on Oct 3, 2017
  14. MarcoFalke referenced this in commit c090b8c8b5 on Oct 3, 2017
  15. MarcoFalke referenced this in commit 26a9e4fe43 on Oct 3, 2017
  16. MarcoFalke referenced this in commit a36f3320a9 on Oct 3, 2017
  17. jasonbcox referenced this in commit e891398960 on Aug 16, 2019
  18. codablock referenced this in commit 5c0e3ea6ef on Sep 24, 2019
  19. barrystyle referenced this in commit 9dbb83dde3 on Jan 22, 2020
  20. random-zebra referenced this in commit d1210fa46e on Apr 23, 2021
  21. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me