Skip to content

Use read only LedgerTxn #3982

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

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions src/herder/HerderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,9 @@ HerderImpl::triggerNextLedger(uint32_t ledgerSeqToTrigger,
// see if we need to include some upgrades
std::vector<LedgerUpgrade> upgrades;
{
LedgerTxn ltx(mApp.getLedgerTxnRoot());
LedgerTxn ltx(mApp.getLedgerTxnRoot(),
/* shouldUpdateLastModified */ true,
TransactionMode::READ_ONLY_WITHOUT_SQL_TXN);
upgrades = mUpgrades.createUpgradesFor(lcl.header, ltx);
}
for (auto const& upgrade : upgrades)
Expand Down Expand Up @@ -1432,7 +1434,8 @@ HerderImpl::setUpgrades(Upgrades::UpgradeParameters const& upgrades)
std::string
HerderImpl::getUpgradesJson()
{
LedgerTxn ltx(mApp.getLedgerTxnRoot());
LedgerTxn ltx(mApp.getLedgerTxnRoot(), /* shouldUpdateLastModified */ true,
TransactionMode::READ_ONLY_WITHOUT_SQL_TXN);
return mUpgrades.getParameters().toDebugJson(ltx);
}

Expand Down
3 changes: 2 additions & 1 deletion src/herder/Upgrades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ Upgrades::isValid(UpgradeType const& upgrade, LedgerUpgradeType& upgradeType,
LedgerHeader const& header) const
{
LedgerUpgrade lupgrade;
LedgerTxn ltx(app.getLedgerTxnRoot());
LedgerTxn ltx(app.getLedgerTxnRoot(), /* shouldUpdateLastModified */ true,
TransactionMode::READ_ONLY_WITHOUT_SQL_TXN);
bool res = isValidForApply(upgrade, lupgrade, app, ltx, header) ==
UpgradeValidity::VALID;

Expand Down