Skip to content

Commit

Permalink
explicitly call gc when not idle
Browse files Browse the repository at this point in the history
Signed-off-by: dorjesinpo <[email protected]>
  • Loading branch information
dorjesinpo committed May 10, 2024
1 parent c23cfa9 commit 0de2409
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/groups/mqb/mqbblp/mqbblp_storagemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace BloombergLP {
namespace mqbblp {

namespace {
const int k_GC_MESSAGES_INTERVAL_SECONDS = 60;
const int k_GC_MESSAGES_INTERVAL_SECONDS = 30;

bsl::ostream& printRecoveryBanner(bsl::ostream& out,
const bsl::string& lastLineSuffix)
Expand Down
2 changes: 1 addition & 1 deletion src/groups/mqb/mqbc/mqbc_storagemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace BloombergLP {
namespace mqbc {

namespace {
const int k_GC_MESSAGES_INTERVAL_SECONDS = 60;
const int k_GC_MESSAGES_INTERVAL_SECONDS = 30;
} // close unnamed namespace

// ----------------------------
Expand Down
9 changes: 2 additions & 7 deletions src/groups/mqb/mqbs/mqbs_filestore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ bool compareByByte(const bsl::pair<mqbu::StorageKey, MessageByteCounter>& lhs,
return lhs.second.second > rhs.second.second;
}

void noOp()
{
// NOTHING
}

} // close unnamed namespace

// -------------------------------------
Expand Down Expand Up @@ -7125,8 +7120,8 @@ void FileStore::flush()
// next k_GC_MESSAGES_INTERVAL_SECONDS.

if (haveMore || haveMoreHistory) {
// Re-enable 'flush' by empty callback
dispatcher()->execute(&noOp,
// Explicitly schedule 'flush()' instead of relying on idleness
dispatcher()->execute(bdlf::BindUtil::bind(&FileStore::flush, this),
this,
mqbi::DispatcherEventType::e_CALLBACK);
}
Expand Down

0 comments on commit 0de2409

Please sign in to comment.