Skip to content

Commit

Permalink
Skip DB migration on nodes where publish is disabled (stellar#4509)
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon authored Oct 21, 2024
2 parents 2493152 + 39ee2d9 commit f9aa8e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/history/HistoryManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ writeCheckpointFile(Application& app, HistoryArchiveState const& has,
void
HistoryManagerImpl::dropSQLBasedPublish()
{
if (!mApp.getHistoryArchiveManager().publishEnabled())
{
// Publish is disabled, nothing to do
return;
}

// soci::transaction is created externally during schema upgrade, so this
// function is atomic
releaseAssert(threadIsMain());
Expand Down Expand Up @@ -660,8 +666,6 @@ HistoryManagerImpl::appendLedgerHeader(LedgerHeader const& header)
{
mCheckpointBuilder.appendLedgerHeader(header);
#ifdef BUILD_TESTS
CLOG_INFO(History, "Appending ledger header for ledger {} {}",
header.ledgerSeq, mThrowOnAppend);
if (header.ledgerSeq == mThrowOnAppend)
{
throw std::runtime_error("Throwing for testing");
Expand Down

0 comments on commit f9aa8e2

Please sign in to comment.