Skip to content

Refactor log router monitoring and re-recruitment - #12642

Merged
jzhou77 merged 3 commits into
apple:mainfrom
jzhou77:fix-nightly
Jan 20, 2026
Merged

jzhou77 merged 3 commits into
apple:mainfrom
jzhou77:fix-nightly

Conversation

@jzhou77

@jzhou77 jzhou77 commented Jan 16, 2026 •

Copy link
Copy Markdown
Collaborator

This logic now is refactored to monitorAndRecruitWorkerSet() actor so that it can be reused for backup workers as well.

This was part of #12564, split from that PR for easy review.

20260116-003003-jzhou-a3261de59a2924df compressed=True data_size=34492678 duration=3538624 ended=100000 fail=1 fail_fast=10 max_runs=100000 pass=99999 priority=100 remaining=0 runtime=1:03:52 sanity=False started=100000 stopped=20260116-013355 submitted=20260116-003003 timeout=5400 username=jzhou

The failure is a newly added test -f ./tests/slow/BulkDumpingS3WithChaos.toml -s 1554084314 -b off

<InternalError Severity="40" ErrorKind="BugDetected" Time="65.263309" DateTime="2026-01-16T01:22:43Z" Type="InternalError" Machine="2.0.1.2:1" ID="0000000000000000" Error="internal_error" ErrorDescription="An internal error occurred" ErrorCode="4100" FailedAssertion="e.code() != error_code_actor_cancelled || !assertOnCancel" File="/root/src/foundationdb/fdbrpc/include/fdbrpc/AsyncFileNonDurable.actor.h" Line="62" ThreadID="18137885391112627656" Backtrace="/usr/local/bin/llvm-addr2line -e /var/joshua/ensembles/20260116-003003-jzhou-a3261de59a2924df/bin/fdbserver -p -C -f -i 0x4c311cf 0x4c314c9 0x4c2b6b4 0x4b5028c 0x4afb411 0x4afb67d 0x4afb0b5 0x40c69d6 0x40c51dc 0x40c4f4b 0x40c0f75 0x40c7600 0x40c00cb 0x40c9c35 0x40c87e2 0x1b18996 0x1b18795 0x1b18d86 0x1b18a9b 0x2e90c4c 0x2e8dcea 0x4b31c1c 0x4b31922 0x4b31cf2 0x4b31825 0x4b32e9c 0x4b32437 0x4b3194d 0x4b31cf2 0x1a0d3e9 0x2ed9c2d 0x2ed9661 0x2ed4016 0x2ed8d38 0x2ed8a49 0x1978a28 0x24363e6 0x243..." LogGroup="default" Roles="BK,CP,CS,DD,MS,RK,RV,SS,TL"/>

cc @saintstack

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)

This logic now is refactored to monitorAndRecruitWorkerSet() actor so that it
can be reused for backup workers as well.
@foundationdb-ci

Copy link
Copy Markdown
Contributor

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

  • Commit ID: 795a89f
  • Duration 0:05:05
  • 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: 795a89f
  • Duration 0:05:05
  • 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-ide on Linux RHEL 9

  • Commit ID: 795a89f
  • Duration 0:05:05
  • 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 on Linux RHEL 9

  • Commit ID: 795a89f
  • Duration 0:05:06
  • 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: 795a89f
  • Duration 0:05:12
  • 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-cluster-tests on Linux RHEL 9

  • Commit ID: 518a70f
  • Duration 0:04:01
  • 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-arm on Linux CentOS 7

  • Commit ID: 518a70f
  • Duration 0:04:06
  • 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-ide on Linux RHEL 9

  • Commit ID: 518a70f
  • Duration 0:04:08
  • 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: 518a70f
  • Duration 0:04:10
  • 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 on macOS Ventura 13.x

  • Commit ID: 795a89f
  • Duration 0:06:10
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} rm -rf foundationdb. Reason: exit status 255
  • 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: 518a70f
  • Duration 0:04:28
  • 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: 795a89f
  • Duration 0:34: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)

@dlambrig dlambrig 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.

one question and nit otherwise lgtm

return Void();
}
when(std::vector<int> failedWorkers = wait(monitor())) {
recruitment = recruit(failedWorkers);

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.

Would there be a problem if recruitment were overwritten while a previous recruitment is still in flight, e.g., if wait(monitor()) fires twice?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If wait(monitor()) fires twice, the second time this assignment will automatically cancel the first recruitment. If the first recruitment already finished, nothing bad here. Repeating recruitment a second time is safe, as consumers of log routers will learn from ServerDBInfo updates of new log routers and switch to use new log routers.

If the first recruitment hasn't finished, the second one would cancel it and does its own recruitment. Since monitor check all log routers. If there are some tags in the first recruitment, but not in the second, the monitor will notice them and fire again.

Since there is a delay(failedRecuitDelay) below, firing twice is unlikely to happen when the first recruitment has not finished, because recruitment is usually a few milliseconds.

Comment thread fdbserver/ClusterController.actor.cpp Outdated
.detail("FailedCount", failedWorkers.size());
}
when(wait(recruitment)) {
failedRecuitDelay = 1.0; // Reset backoff on success

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.

nit "failedRecruitDelay"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

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

  • Commit ID: b89e4e4
  • Duration 0:07:17
  • Result: ❌ FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} rm -rf foundationdb. Reason: exit status 255
  • 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: b89e4e4
  • Duration 0:24:09
  • 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: b89e4e4
  • Duration 0:34:00
  • 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: b89e4e4
  • Duration 0:41:49
  • Result: ❌ FAILED
  • Error: Error while executing command: ctest -j ${NPROC} --no-compress-output -T test --output-on-failure. Reason: exit status 8
  • 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: b89e4e4
  • Duration 0:45:13
  • 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: b89e4e4
  • Duration 0:49:10
  • 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: b89e4e4
  • Duration 1:59:51
  • 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 commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator Author

ctest failure is unrelated:

39/55 Test #52: java-integration-external-client ..................***Failed    5.89 sec
Database created
Jan 16, 2026 5:00:11 AM org.junit.platform.launcher.core.EngineDiscoveryOrchestrator lambda$logTestDescriptorExclusionReasons$7
INFO: 0 containers and 13 tests were excluded because tags do not match tag expression(s): [SupportsExternalClient]
external_client_library : /codebuild/output/src23759710/src/github.com/apple/foundationdb/build_output/bindings/c/libfdb_c_external.so

Failures (1):
  JUnit Jupiter:WatchesIntegrationTest:testWatchesOverTheLimit()
    MethodSource [className = 'com.apple.foundationdb.WatchesIntegrationTest', methodName = 'testWatchesOverTheLimit', methodParameterType
s = '']
    => org.opentest4j.AssertionFailedError: Watch limit not imposed
       org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)
       org.junit.jupiter.api.Assertions.fail(Assertions.java:117)
       com.apple.foundationdb.WatchesIntegrationTest.testWatchesOverTheLimit(WatchesIntegrationTest.java:124)
       java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       java.base/java.lang.reflect.Method.invoke(Method.java:566)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
       org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
       org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
       [...]

Test run finished after 1043 ms
[         3 containers found      ]
[         0 containers skipped    ]
[         3 containers started    ]
[         0 containers aborted    ]
[         3 containers successful ]
[         0 containers failed     ]
[        11 tests found           ]
[         0 tests skipped         ]
[        11 tests started         ]
[         0 tests aborted         ]
[        10 tests successful      ]
[         1 tests failed          ]

@jzhou77

jzhou77 commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator Author

Another is s3 test, also unrelated. cc @saintstack

21/55 Test  #2: s3client_test .....................................***Failed   20.03 sec
2026-01-16T04:59:34+00:00 Testing against MockS3Server
...
2026-01-16T04:59:53+00:00 All 6 files found in listing (attempt 1)
2026-01-16T04:59:53+00:00 ERROR: Missing s3client/ls_test/sub1/file2_2 in ls output
2026-01-16T04:59:53+00:00 === DEBUG: Recursive ls output ===
Contents of blobstore://127.0.0.1:8081/s3client/ls_test?bucket=test-bucket&region=us-east-1&secure_connection=0:
 s3client/ls_test/file1_1 26.00 B
 s3client/ls_test/file1_2 26.00 B
 s3client/ls_test/sub1/file2_1 26.00 B
 s3client/ls_test/sub1/file2_2 26.00 B
 s3client/ls_test/sub1/sub2/file3_1 26.00 B
 s3client/ls_test/sub1/sub2/file3_2 26.00 B
2026-01-16T04:59:53+00:00 === END DEBUG ===

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: b89e4e4
  • Duration 1:03:40
  • 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)

jzhou77 added a commit to jzhou77/foundationdb that referenced this pull request Jan 16, 2026
File read can't be cancelled, so we have to hold on the buffer and issue reads.

This was found in apple#12642 test, seed:

-f ./tests/slow/BulkDumpingS3WithChaos.toml -s 1554084314 -b off
@jzhou77
jzhou77 merged commit 8c1a69b into apple:main Jan 20, 2026
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