Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jorisdral opened this issue Feb 19, 2025 · 0 comments
Open

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

jorisdral opened this issue Feb 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@jorisdral
Copy link
Collaborator

jorisdral commented Feb 19, 2025

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)
@jorisdral jorisdral added the bug Something isn't working label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant