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

Avoid flushing on wbcache non dirty buffers in merge case #293

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

sanebay
Copy link
Contributor

@sanebay sanebay commented Jan 30, 2024

Issue
[resource_mgr.cpp:39] ******************** Assertion failure: =====> Expected '-4096' to be >= to '0'

Fix
In merge case, even if merge is required, we call prepare txn and connect the left and parent. But during merge, we find merge is not required. The child node is modified but its next point to parent which is not modified or dirty. The child node is added to dirty list. Now during flushing, after child flush, it goes to next parent buffer and flushes that too even if its not dirty. This causes mismatch in m_hs_dirty_buf_cnt. Any buffer needs to flush should go through write_buf(). Its too complicated to unwind the prepare_txn in merge. Instead if the parent is not dirty ignore while flushing.

In merge case, if merge not required and prep txn already called, parent wont be dirty and we flush the cache causing invalid dirty buffer count. Concurrent insert vector iterators can't be reused.

./bin/test_index_btree --num_entries=500000
500k entries
[==========] 36 tests from 8 test suites ran. (11957416 ms total)
[ PASSED ] 36 tests

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2024

Codecov Report

Attention: 191 lines in your changes are missing coverage. Please review.

Comparison is base (64600e9) 62.60% compared to head (6b6327c) 59.71%.
Report is 2 commits behind head on master.

Files Patch % Lines
src/lib/replication/repl_dev/raft_repl_dev.cpp 0.00% 66 Missing ⚠️
src/lib/replication/service/raft_repl_service.cpp 0.00% 35 Missing ⚠️
...rc/lib/replication/repl_dev/raft_state_machine.cpp 0.00% 23 Missing ⚠️
src/lib/replication/service/generic_repl_svc.cpp 0.00% 14 Missing ⚠️
src/include/homestore/superblk_handler.hpp 53.57% 11 Missing and 2 partials ⚠️
src/lib/homestore.cpp 58.82% 4 Missing and 3 partials ⚠️
.../lib/replication/log_store/home_raft_log_store.cpp 0.00% 7 Missing ⚠️
src/lib/replication/repl_dev/solo_repl_dev.cpp 0.00% 7 Missing ⚠️
src/include/homestore/replication/repl_dev.h 0.00% 5 Missing ⚠️
src/lib/index/index_cp.hpp 0.00% 4 Missing ⚠️
... and 6 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
- Coverage   62.60%   59.71%   -2.89%     
==========================================
  Files         110      110              
  Lines        8990     9115     +125     
  Branches     1156     1173      +17     
==========================================
- Hits         5628     5443     -185     
- Misses       2829     3138     +309     
- Partials      533      534       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@shosseinimotlagh shosseinimotlagh left a comment

Choose a reason for hiding this comment

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

LG

In merge case, if merge not required and prep txn already called,
parent wont be dirty adn we flush the cache causing invalid
dirty buffer count. Concurrent thread iterators can't be reused.
@shosseinimotlagh shosseinimotlagh added this to the MileStone4.1 milestone Jan 31, 2024
@hkadayam hkadayam linked an issue Jan 31, 2024 that may be closed by this pull request
@sanebay sanebay merged commit 9aa7baa into eBay:master Jan 31, 2024
20 checks passed
@sanebay sanebay deleted the wbcache_fix branch January 31, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index long running failed with mismatched resource mgr count
3 participants