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

unit tests: Fix GlobalAndWBMSetupDelay #589

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

Yuval-Ariel
Copy link
Contributor

@Yuval-Ariel Yuval-Ariel commented Jul 2, 2023

RUN ] GlobalWriteControllerTest.GlobalAndWBMSetupDelay
db/global_write_controller_test.cc:391: Failure
Value of: options.write_buffer_manager->memory_usage() < 5_kb
Actual: false
Expected: true
FAILED ] [GlobalWriteControllerTest.GlobalAndWBMSetupDelay (44 ms)

The memory is freed only when the detor of the version is called in job_context.Clean(); under DBImpl::BackgroundCallFlush .

The problem was that calling Flush with FlushOptions.wait = true, doesn't wait for the memory to be free which also happens during the flush process.
So the fix is adding a sync point which delays the assertion of checking the WBM memory usage to after the flush cleared the memtable memory.

The problem was that calling Flush with FlushOptions.wait = true,
doesn't wait for the memory to be free which also happens during the
flush process.
So the fix is adding a sync point which delays the assertion of checking
the WBM memory usage to after the flush cleared the memtable memory.
@Yuval-Ariel Yuval-Ariel added the bug fix Fixes a known bug label Jul 2, 2023
@Yuval-Ariel Yuval-Ariel requested a review from ofriedma July 2, 2023 06:49
@Yuval-Ariel Yuval-Ariel self-assigned this Jul 2, 2023
Copy link
Contributor

@ofriedma ofriedma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yuval-Ariel Yuval-Ariel merged commit a785634 into main Jul 3, 2023
@Yuval-Ariel Yuval-Ariel deleted the unit-tests-fix-for-GlobalAndWBMSetupDelay branch July 3, 2023 06:23
udi-speedb pushed a commit that referenced this pull request Nov 22, 2023
The problem was that calling Flush with FlushOptions.wait = true,
doesn't wait for the memory to be freed which also happens during the
flush process.
So the fix is adding a sync point which delays the assertion of checking
the WBM memory usage to after the flush cleared the memtable memory.
udi-speedb pushed a commit that referenced this pull request Dec 5, 2023
The problem was that calling Flush with FlushOptions.wait = true,
doesn't wait for the memory to be freed which also happens during the
flush process.
So the fix is adding a sync point which delays the assertion of checking
the WBM memory usage to after the flush cleared the memtable memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fixes a known bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants