Skip to content

Fix flaky loadgen failure in MissionDatabaseInplaceUpgrade#410

Merged
marta-lokhova merged 4 commits into
mainfrom
fix-dbinplaceupgrade-loadgen-flake
Jul 17, 2026
Merged

Fix flaky loadgen failure in MissionDatabaseInplaceUpgrade#410
marta-lokhova merged 4 commits into
mainfrom
fix-dbinplaceupgrade-loadgen-flake

Conversation

@sisuresh

@sisuresh sisuresh commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

MissionDatabaseInplaceUpgrade intermittently fails with Loadgen failed! on the after-upgrade node.

That node is a watcher outside the quorum, started mid-run from a DB snapshot, so it catches up while the validators keep closing 1 ledger/sec. When a catchup round finishes, core reports Synced! even if the network has since moved on (in the failing run ssc-2109z-39a050: node at ledger 167, validators at 206), and keeps reporting it while stalled waiting for the next round. WaitUntilSynced only polls the state string, so the mission starts loadgen against a node whose local ledger isn't advancing, and loadgen times out after ~20s. Whether the last catchup round lands on the live tip or behind it is timing luck — hence the flake.

Fix

Add Peer.WaitUntilCaughtUpWith(other) and call it after WaitUntilSynced on the after-upgrade node, with a core validator as reference. It waits until the node is within a couple of ledgers of the reference peer's latest, re-read on every poll so it holds across however many catchup rounds are needed. This generalizes the WaitForLedgerNum-against-a-live-peer idiom MissionSorobanCatchupWithPrevAndCurr already uses into a reusable helper.

Testing

dotnet build clean, dotnet test 15/15, fantomas --check clean.

The after-upgrade node is a watcher outside the quorum. When its catchup
finishes applying buffered ledgers it flips to LM_SYNCED_STATE and reports
"Synced!" even if the validators have since moved on (they close 1
ledger/sec with accelerated time, and the catchup replay takes long enough
for them to get ~40 ledgers ahead). WaitUntilSynced only polls the state
string, so it can return during that transient window; the mission then
runs loadgen against a node whose local ledger is stalled until its next
catchup round, and core's loadgen times out (~20s without local ledger
closes) and reports the run failed.

Add Peer.WaitUntilCaughtUpWith, which waits until a node reaches the
ledger a reference peer has already closed, and use it in the mission to
make sure the upgraded node is actually tracking the live network before
generating load on it. MissionSorobanCatchupWithPrevAndCurr already uses
the same WaitForLedgerNum idiom for its catchup node.
Copilot AI review requested due to automatic review settings July 17, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds synchronization safeguards before running loadgen on an upgraded watcher node.

Changes:

  • Adds a peer catchup helper.
  • Uses it after the database upgrade synchronization step.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
StellarCoreHTTP.fs Adds peer catchup waiting logic.
MissionDatabaseInplaceUpgrade.fs Waits before starting loadgen.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/FSLibrary/StellarCoreHTTP.fs Outdated
sisuresh added 3 commits July 17, 2026 15:12
Sampling the reference ledger once is not enough if the node needs more
than two catchup rounds: a second round's catchup target necessarily lies
beyond the sampled ledger, so the wait would pass even if that round also
landed behind the live tip and the node stalled again. Re-reading the
reference peer's ledger on each poll and requiring a small gap only passes
once the node is genuinely tracking the network, regardless of how many
rounds that takes.
@sisuresh
sisuresh requested a review from graydon July 17, 2026 22:22
@sisuresh
sisuresh requested a review from marta-lokhova July 17, 2026 22:25

@marta-lokhova marta-lokhova left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@marta-lokhova
marta-lokhova merged commit a98296f into main Jul 17, 2026
7 checks passed
@marta-lokhova
marta-lokhova deleted the fix-dbinplaceupgrade-loadgen-flake branch July 17, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants