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

version_set_test (Failed) #196

Open
yapple opened this issue Dec 28, 2021 · 2 comments
Open

version_set_test (Failed) #196

yapple opened this issue Dec 28, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@yapple
Copy link
Collaborator

yapple commented Dec 28, 2021

[BUG]

Expected behavior

test passed

Actual behavior

[  FAILED  ] 4 tests, listed below:
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamic
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamicLotsOfData
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamicLargeLevel
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamicWithLargeL0_1

Steps to reproduce the behavior

./version_set_test

[Enhancement]

Problem

Solution

@yapple
Copy link
Collaborator Author

yapple commented Dec 28, 2021

/data00/wangyi/github-terarkdb/db/version_set_test.cc:218: Failure
Expected equality of these values:
  vstorage_.MaxBytesForLevel(4)
    Which is: 1000
  1005U
    Which is: 1005
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamic (0 ms)
[ RUN      ] VersionStorageInfoTest.MaxBytesForLevelDynamicLotsOfData
/data00/wangyi/github-terarkdb/db/version_set_test.cc:246: Failure
Expected equality of these values:
  vstorage_.MaxBytesForLevel(4)
    Which is: 836
  800U
    Which is: 800
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamicLotsOfData (0 ms)
[ RUN      ] VersionStorageInfoTest.MaxBytesForLevelDynamicLargeLevel
/data00/wangyi/github-terarkdb/db/version_set_test.cc:265: Failure
Expected equality of these values:
  vstorage_.MaxBytesForLevel(5)
    Which is: 2999999999889
  3000U * kOneGB
    Which is: 3000000000000
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamicLargeLevel (0 ms)
[ RUN      ] VersionStorageInfoTest.MaxBytesForLevelDynamicWithLargeL0_1
/data00/wangyi/github-terarkdb/db/version_set_test.cc:292: Failure
Expected equality of these values:
  vstorage_.level_multiplier()
    Which is: 3.5
  5.0
    Which is: 5
[  FAILED  ] VersionStorageInfoTest.MaxBytesForLevelDynamicWithLargeL0_1 (0 ms)

@yapple
Copy link
Collaborator Author

yapple commented Dec 28, 2021

we do more aggresive lsm-tree shape adjust through remove the adjust trigger

if (l0_size > base_level_size &&
          (l0_size > options.max_bytes_for_level_base ||
           static_cast<int>(files_[0].size() / 2) >=
               options.level0_file_num_compaction_trigger)) {
        // We adjust the base level according to actual L0 size, and adjust
        // the level multiplier accordingly, when:
        //   1. the L0 size is larger than level size base, or
        //   2. number of L0 files reaches twice the L0->L1 compaction trigger
        // We don't do this otherwise to keep the LSM-tree structure stable
        // unless the L0 compaction is backlogged.
        base_level_size = l0_size;
        if (base_level_ == num_levels_ - 1) {
          level_multiplier_ = 1.0;
        } else {
          level_multiplier_ = std::pow(
              static_cast<double>(max_level_size) /
                  static_cast<double>(base_level_size),
              1.0 / static_cast<double>(num_levels_ - base_level_ - 1));
        }
      }

@yapple yapple added the bug Something isn't working label Dec 29, 2021
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