Skip to content

[BUG] Compact index tests no longer generate clashing keys #580

Closed
@jorisdral

Description

@jorisdral

The pages that generated for compact index tests no longer include pages that have clashing keys. It is important to restore these clashes: without clashes, we are not testing clash recovery logic that is baked into index construction and index search. To restore clashes, the generators have to be updated to generate clashing keys with a higher probability or to fix whatever is preventing those clashing keys from being generated. Moreover, we should guard against any similar future regressions by including a property like coverTable to ensure that clashes occur at least some percenage of the time.

On main, commit 02e3bf6:

❯ cabal run lsm-tree-test -- -p '$NF=="prop_distribution @KeyForIndexCompact"'
lsm-tree
  Test.Database.LSMTree.Internal.Index.Compact
    prop_distribution @KeyForIndexCompact: OK (0.02s)
      +++ OK, passed 100 tests (0% Has clashing multi-page values).

      # Clashes (100 in total):
      100% n == 0

      # Contiguous clash runs (100 in total):
      100% n == 0

      # Logical pages (100 in total):
      51% 10 <= n < 100
      41% 1 <= n < 10
       8% n == 0

      # MultiPageOneKey logical pages (100 in total):
      68% n == 0
      32% 1 <= n < 10

      # OnePageManyKeys logical pages (100 in total):
      48% 10 <= n < 100
      38% 1 <= n < 10
      14% n == 0

      # OnePageOneKey logical pages (100 in total):
      56% 1 <= n < 10
      44% n == 0

      # True pages (100 in total):
      56% 10 <= n < 100
      36% 1 <= n < 10
       8% n == 0

All 1 tests passed (0.02s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions