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

Apply transaction batches in periodic intervals. #4504

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ install (
src/ripple/basics/StringUtilities.h
src/ripple/basics/TaggedCache.h
src/ripple/basics/tagged_integer.h
src/ripple/basics/SubmitSync.h
src/ripple/basics/ThreadSafetyAnalysis.h
src/ripple/basics/ToString.h
src/ripple/basics/UnorderedContainers.h
Expand Down
2 changes: 1 addition & 1 deletion cfg/rippled-example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
#
# Configure the maximum number of transactions to have in the job queue
#
# Must be a number between 100 and 1000, defaults to 250
# Must be a number between 1000 and 100000, defaults to 10000
#
#
# [overlay]
Expand Down
2 changes: 1 addition & 1 deletion cfg/rippled-reporting.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
#
# Configure the maximum number of transactions to have in the job queue
#
# Must be a number between 100 and 1000, defaults to 250
# Must be a number between 1000 and 100000, defaults to 10000
#
#
# [overlay]
Expand Down
33 changes: 18 additions & 15 deletions src/ripple/app/ledger/impl/LedgerMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,22 +549,25 @@ void
LedgerMaster::applyHeldTransactions()
{
std::lock_guard sl(m_mutex);
// It can be expensive to modify the open ledger even with no transactions
// to process. Regardless, make sure to reset held transactions with
// the parent.
if (mHeldTransactions.size())
{
app_.openLedger().modify([&](OpenView& view, beast::Journal j) {
bool any = false;
for (auto const& it : mHeldTransactions)
{
ApplyFlags flags = tapNONE;
auto const result =
app_.getTxQ().apply(app_, view, it.second, flags, j);
if (result.second)
any = true;
}
return any;
});
}

app_.openLedger().modify([&](OpenView& view, beast::Journal j) {
bool any = false;
for (auto const& it : mHeldTransactions)
{
ApplyFlags flags = tapNONE;
auto const result =
app_.getTxQ().apply(app_, view, it.second, flags, j);
if (result.second)
any = true;
}
return any;
});

// VFALCO TODO recreate the CanonicalTxSet object instead of resetting
// it.
// VFALCO NOTE The hash for an open ledger is undefined so we use
// something that is a reasonable substitute.
mHeldTransactions.reset(app_.openLedger().current()->info().parentHash);
Expand Down
1 change: 1 addition & 0 deletions src/ripple/app/main/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,7 @@ ApplicationImp::start(bool withTimers)
{
setSweepTimer();
setEntropyTimer();
m_networkOPs->setBatchApplyTimer();
}

m_io_latency_sampler.start();
Expand Down
Loading