Skip to content

Commit

Permalink
Flusing repl svc at last (#553)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxi Chen <[email protected]>
  • Loading branch information
xiaoxichen committed Sep 18, 2024
1 parent 46e9fe4 commit 333d05b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.4.60"
version = "6.4.61"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
10 changes: 9 additions & 1 deletion src/lib/checkpoint/cp_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,19 @@ void CPManager::cp_start_flush(CP* cp) {
HS_PERIODIC_LOG(INFO, cp, "Starting CP {} flush", cp->id());
cp->m_cp_status = cp_status_t::cp_flushing;

for (auto& consumer : m_cp_cb_table) {
for (size_t svcid = 0; svcid < (size_t)cp_consumer_t::SENTINEL; svcid++) {
if (svcid == (size_t)cp_consumer_t::REPLICATION_SVC) {
continue;
}
auto& consumer = m_cp_cb_table[svcid];
if (consumer) { futs.emplace_back(std::move(consumer->cp_flush(cp))); }
}

folly::collectAllUnsafe(futs).thenValue([this, cp](auto) {
// Sync flushing replication svc at last as the cp_lsn updated here
// other component should at least flushed to cp_lsn
auto& repl_cp = m_cp_cb_table[(size_t)cp_consumer_t::REPLICATION_SVC];
if (repl_cp) {repl_cp->cp_flush(cp).wait();}
// All consumers have flushed for the cp
on_cp_flush_done(cp);
});
Expand Down

0 comments on commit 333d05b

Please sign in to comment.