Repository navigation
Backport four bug fixes from main to release-7.4 (#12318, #12643, #12750, #12755) - #13871
Merged
Merged
Conversation
saintstack
approved these changes
Aug 14, 2026
saintstack
left a comment
Contributor
There was a problem hiding this comment.
LGTM (and to copilot review)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
spraza
force-pushed
the
port-7.4-audit-batch1
branch
from
August 17, 2026 16:43
750bd66 to
e9e8dba
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Authored-by: Baptiste Merliot <42059119+BMerliot@users.noreply.github.com> (cherry picked from commit fba84d9 on main)
(cherry picked from commit 5789c55 on main)
To reproduce clang build at 7.3.69
seed: -f ./tests/restarting/from_7.3.0_until_7.4.0/SnapTestAttrition-1.toml -s 1392115560 -b on
Setup
- dataDistribution is running its main loop. The actors vector (non-state) holds all the sub-actors including DataDistributionTracker::run.
- trackerCancelled (state bool) is false.
- The tracker has finished trackInitialShards and is sitting inside the loop choose, waiting on multiple futures including loggingTrigger.
- loggingTrigger is state Future<Void>. It was initialized as Void() — an already-completed future. After the first firing, it gets reset to delay(...). So on the very first iteration
of the loop, it fires immediately.
The trigger — an error in another actor
1. Some other actor in actors throws (e.g. movekeys_conflict from a DDTeamCollection actor). waitForAll(actors) propagates this error out of wait(waitForAll(actors)).
2. Execution enters the catch block at DataDistribution.actor.cpp:1114.
3. Line 1115: trackerCancelled = true.
4. Team collection References are cleared (lines 1129–1131). This destroys DDTeamCollection objects synchronously.
5. The error is not actor_cancelled, so we reach line 1142: wait(shards.clearAsync()). The actor suspends here. shards is a state KeyRangeMap<ShardTrackedData> — clearing a large map
is broken into async chunks to avoid starving the event loop.
The pending network response fires during the yield
6. The FDB simulator event loop picks up the next task: a WaitMetrics reply from a storage server arrives for one of the trackShardMetrics actors.
7. SAV<StorageMetrics>::finishSendAndDelPromiseRef() fires its callbacks synchronously in a chain:
- TrackShardMetricsActor receives the WaitMetrics reply and updates its AsyncVar<Optional<ShardMetrics>> via set().
- AsyncVar::set destroys the old onChange Promise<Void>, sends to the onChange listeners
- The QuorumCallback inside changeSizes (or GetFirstSizeActor) fires, completing the quorum. changeSizes completes.
- trackInitialShards resumes after wait(changeSizes(...)). It calls self->readyToStart.send(Void()), then hits wait(initialSize). If initialSize is already satisfied (all shards
have reported), trackInitialShards returns.
- DataDistributionTrackerImpl::run resumes at a_body1cont2 — i.e., after wait(trackInitialShards(...)).
8. Without any trackerCancelled check, run proceeds straight into the loop choose for the first time — a_body1cont2loopHead1 in the generated code.
The crash
9. The loop choose evaluates which futures are ready. loggingTrigger was initialized as Void() and has never been reset yet (this is the first entry into the loop). It is already
complete.
10. The when(wait(loggingTrigger)) branch fires immediately and executes:
TraceEvent("DDTrackerStats", self->distributorId)
.detail("Shards", self->shards->size()) // <-- CRASH
11. self->shards is a raw KeyRangeMap<ShardTrackedData>* pointing at the state shards variable back in dataDistribution. That shards is in the middle of clearAsync() — its internal
structure is partially destroyed/invalid.
12. Accessing shards->size() on a partially-cleared KeyRangeMap causes a segfault. Signal 11 (SIGSEGV).
(cherry picked from commit 3f15166 on main)
…ple#12755) (cherry picked from commit df5a98d on main)
spraza
force-pushed
the
port-7.4-audit-batch1
branch
from
August 18, 2026 17:37
e9e8dba to
6e3c995
Compare
spraza
marked this pull request as ready for review
August 18, 2026 17:37
akankshamahajan15
approved these changes
Aug 18, 2026
neethuhaneesha
approved these changes
Aug 18, 2026
Contributor
Result of foundationdb-pr-clang on Linux RHEL 9
|
Contributor
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
Contributor
Result of foundationdb-pr-macos on macOS 14.x
|
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-macos-m1 on macOS 14.x
|
Contributor
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
Contributor
Result of foundationdb-pr on Linux RHEL 9
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports four already-merged
mainbug fixes torelease-7.4, ahead of 7.4.7.Did not fully backport number 2 above, either because part of it was already there, or part of it had its logic changed. For the latter, I'll do more research and open a new PR if needed.
100K: 20260813-181902-praza-port-7.4-audit-batch1-1e1c9c9a89774015, 100000/100000 pass