Skip to content

Track min popped version separately for system localities in TLog - #12755

Merged
jzhou77 merged 2 commits into
apple:mainfrom
jzhou77:mailmap
Mar 7, 2026
Merged

jzhou77 merged 2 commits into
apple:mainfrom
jzhou77:mailmap

Conversation

@jzhou77

@jzhou77 jzhou77 commented Mar 6, 2026 •

Copy link
Copy Markdown
Collaborator

Add minSysPopTagVersion/minSysPopTag to LogData to track the minimum popped version among system-locality tags (locality < 0), keeping the existing minPoppedTagVersion/minPoppedTag for non-system tags (locality >= 0). Expose the new fields via specialCounters (MinSysPopTagVersion/Locality/Id).

TLogMetrics now has:

MinPoppedTagVersion=1434572001 MinPoppedTagLocality=1 MinPoppedTagId=1 MinSysPopTagVersion=9223372036854775807 MinSysPopTagLocality=-1 MinSysPopTagId=0

20260306-214946-jzhou-55db501c0068ea59 compressed=True data_size=33140490 duration=8038886 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=1:27:18 sanity=False started=100000 stopped=20260306-231704 submitted=20260306-214946 timeout=5400 username=jzhou

Code-Reviewer Section

The general pull request guidelines can be found here.

Please check each of the following things and check all boxes before accepting a PR.

  • The PR has a description, explaining both the problem and the solution.
  • The description mentions which forms of testing were done and the testing seems reasonable.
  • Every function/class/actor that was touched is reasonably well documented.

For Release-Branches

If this PR is made against a release-branch, please also check the following:

  • This change/bugfix is a cherry-pick from the next younger branch (younger release-branch or main if this is the youngest branch)
  • There is a good reason why this PR needs to go into a release branch and this reason is documented (either in the description above or in a linked GitHub issue)

Add minSysPopTagVersion/minSysPopTag to LogData to track the minimum
popped version among system-locality tags (locality < 0), keeping the
existing minPoppedTagVersion/minPoppedTag for non-system tags (locality >= 0).
Expose the new fields via specialCounters (MinSysPopTagVersion/Locality/Id).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: a7ff005
  • Duration 0:04:15
  • Result: ❌ FAILED
  • Error: Error while executing command: if [[ $(git diff --shortstat 2> /dev/null | tail -n1) == "" ]]; then echo "CODE FORMAT CLEAN"; else echo "CODE FORMAT NOT CLEAN"; echo; echo "THE FOLLOWING FILES NEED TO BE FORMATTED"; echo; git ls-files -m; echo; if [[ $FDB_VERSION =~ 7\.\3. ]]; then echo skip; else exit 1; fi; fi. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: a7ff005
  • Duration 0:04:23
  • Result: ❌ FAILED
  • Error: Error while executing command: if [[ $(git diff --shortstat 2> /dev/null | tail -n1) == "" ]]; then echo "CODE FORMAT CLEAN"; else echo "CODE FORMAT NOT CLEAN"; echo; echo "THE FOLLOWING FILES NEED TO BE FORMATTED"; echo; git ls-files -m; echo; if [[ $FDB_VERSION =~ 7\.\3. ]]; then echo skip; else exit 1; fi; fi. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux CentOS 7

  • Commit ID: a7ff005
  • Duration 0:04:21
  • Result: ❌ FAILED
  • Error: Error while executing command: if [[ $(git diff --shortstat 2> /dev/null | tail -n1) == "" ]]; then echo "CODE FORMAT CLEAN"; else echo "CODE FORMAT NOT CLEAN"; echo; echo "THE FOLLOWING FILES NEED TO BE FORMATTED"; echo; git ls-files -m; echo; if [[ $FDB_VERSION =~ 7\.\3. ]]; then echo skip; else exit 1; fi; fi. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux RHEL 9

  • Commit ID: a7ff005
  • Duration 0:04:23
  • Result: ❌ FAILED
  • Error: Error while executing command: if [[ $(git diff --shortstat 2> /dev/null | tail -n1) == "" ]]; then echo "CODE FORMAT CLEAN"; else echo "CODE FORMAT NOT CLEAN"; echo; echo "THE FOLLOWING FILES NEED TO BE FORMATTED"; echo; git ls-files -m; echo; if [[ $FDB_VERSION =~ 7\.\3. ]]; then echo skip; else exit 1; fi; fi. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux RHEL 9

  • Commit ID: a7ff005
  • Duration 0:04:42
  • Result: ❌ FAILED
  • Error: Error while executing command: if [[ $(git diff --shortstat 2> /dev/null | tail -n1) == "" ]]; then echo "CODE FORMAT CLEAN"; else echo "CODE FORMAT NOT CLEAN"; echo; echo "THE FOLLOWING FILES NEED TO BE FORMATTED"; echo; git ls-files -m; echo; if [[ $FDB_VERSION =~ 7\.\3. ]]; then echo skip; else exit 1; fi; fi. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: a7ff005
  • Duration 0:31:42
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@spraza spraza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lgtm. Btw CI is showing some formatting failures.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS Ventura 13.x

  • Commit ID: a7ff005
  • Duration 0:48:19
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux RHEL 9

  • Commit ID: 152df12
  • Duration 0:22:48
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x

  • Commit ID: 152df12
  • Duration 0:32:25
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux CentOS 7

  • Commit ID: 152df12
  • Duration 0:43:41
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS Ventura 13.x

  • Commit ID: 152df12
  • Duration 0:48:31
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 152df12
  • Duration 0:52:01
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 152df12
  • Duration 0:52:31
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux RHEL 9

  • Commit ID: 152df12
  • Duration 1:59:05
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@jzhou77
jzhou77 merged commit df5a98d into apple:main Mar 7, 2026
spraza added a commit to spraza/foundationdb that referenced this pull request Aug 17, 2026
spraza added a commit to spraza/foundationdb that referenced this pull request Aug 18, 2026
spraza added a commit that referenced this pull request Aug 18, 2026
, #12755) (#13871)

* Fix circular recursion in Snapshot.Option (#12318)

Authored-by: Baptiste Merliot <42059119+BMerliot@users.noreply.github.com>

(cherry picked from commit fba84d9 on main)

* Fix a few file read cancellation bugs (#12643)

(cherry picked from commit 5789c55 on main)

* Fix a DD shutdown crash (#12750)

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)

* Track min popped version separately for system localities in TLog (#12755)

(cherry picked from commit df5a98d on main)
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