Skip to content

complete the ctx future if no dirty to unblock cp flush#867

Closed
JacksonYao287 wants to merge 1 commit intoeBay:masterfrom
JacksonYao287:complete_future_if_no_dirty_buf
Closed

complete the ctx future if no dirty to unblock cp flush#867
JacksonYao287 wants to merge 1 commit intoeBay:masterfrom
JacksonYao287:complete_future_if_no_dirty_buf

Conversation

@JacksonYao287
Copy link
Contributor

Bug:
when there is no dirty buf in index table (example : all read ops or no ops), if we trigger cp flush, then future in cp_ctx of index will not be completed and then the whole cp_flush is stuck.

Fix:
complete the future in cp_ctx if dirty buf is empty

@JacksonYao287 JacksonYao287 marked this pull request as draft March 3, 2026 23:20
@JacksonYao287 JacksonYao287 marked this pull request as ready for review March 3, 2026 23:20
@JacksonYao287 JacksonYao287 marked this pull request as draft March 3, 2026 23:35
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.40%. Comparing base (1a0cef8) to head (99ce6f2).
⚠️ Report is 320 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/index/wb_cache.cpp 0.00% 3 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #867      +/-   ##
==========================================
- Coverage   56.51%   48.40%   -8.11%     
==========================================
  Files         108      110       +2     
  Lines       10300    12881    +2581     
  Branches     1402     6184    +4782     
==========================================
+ Hits         5821     6235     +414     
+ Misses       3894     2548    -1346     
- Partials      585     4098    +3513     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

} else {
CP_PERIODIC_LOG(DEBUG, unmove(cp_ctx->id()), "Btree does not have any dirty buffers to flush");
}
return folly::makeFuture< bool >(true); // nothing to flush
Copy link
Contributor

Choose a reason for hiding this comment

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

when there is no dirty buffers flushing stopped here. the flushing doesn't reach to your change. Please look at my change in #861

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.

I am not convinced that this bug can lead to cp stuck. It will be great if you may write a simple UT to verify the bug.
1- write in index
2- restart
3- read only
(CP should stuck )

@JacksonYao287
Copy link
Contributor Author

@shosseinimotlagh I will try to add a UT for this

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.

3 participants