From 99ce6f22bc565e92c767b0b304bc1894c6c86c3c Mon Sep 17 00:00:00 2001 From: Jie Yao Date: Wed, 4 Mar 2026 07:09:33 +0800 Subject: [PATCH] complete the ctx future if no dirty to unblock cp flush --- conanfile.py | 2 +- src/lib/index/wb_cache.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 44682331a..7f866cdad 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class HomestoreConan(ConanFile): name = "homestore" - version = "7.4.4" + version = "7.4.5" homepage = "https://github.com/eBay/Homestore" description = "HomeStore Storage Engine" diff --git a/src/lib/index/wb_cache.cpp b/src/lib/index/wb_cache.cpp index 769861e75..1682a8ff5 100644 --- a/src/lib/index/wb_cache.cpp +++ b/src/lib/index/wb_cache.cpp @@ -863,6 +863,15 @@ folly::Future< bool > IndexWBCache::async_cp_flush(IndexCPContext* cp_ctx) { IndexBufferPtrList buf_list; get_next_bufs(cp_ctx, resource_mgr().get_dirty_buf_qd(), buf_list); + if (buf_list.empty()) { + LOGTRACEMOD(wbcache, "No more buffers to flush for cp {}, exiting flush iteration", cp_ctx->id()); + // if no dirty buffer, we should complete the cp_ctx here, otherwise it will be waiting for ever and + // block the next CP from flushing + m_vdev->cp_flush(cp_ctx); + cp_ctx->complete(true); + return; + } + for (auto& buf : buf_list) { do_flush_one_buf(cp_ctx, buf, true); }