Go binding: add GetClientStatus method to Database
Add GetClientStatus method to Database.
Allow fetching client status JSON information for any database. Added a test to make sure that it works with an open database.
NOTE: it depends on https://github.com/apple/foundationdb/pull/11611 being merged first, otherwise it will not build
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.
- [x] The PR has a description, explaining both the problem and the solution.
- [x] The description mentions which forms of testing were done and the testing seems reasonable.
- [x] 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-branchormainif 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)
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:10:15
- Result: :x: FAILED
- Error:
Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /opt/homebrew/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1 - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-macos on macOS Ventura 13.x
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:11:33
- Result: :x: FAILED
- Error:
Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1 - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang-ide on Linux CentOS 7
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:25:08
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang on Linux CentOS 7
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:30:16
- Result: :x: FAILED
- Error:
Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1 - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr on Linux CentOS 7
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:36:40
- Result: :x: FAILED
- Error:
Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1 - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:40:29
- Result: :x: FAILED
- Error:
Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. 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)
Result of foundationdb-pr-clang-arm on Linux CentOS 7
- Commit ID: 6e6cc685b1f4e1bd3fff69c71d4035c669371828
- Duration 0:45:08
- Result: :x: FAILED
- Error:
Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1 - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Changes LGTM, do you think it make sense to have a go struct that can be used to deserialize the result?
I was going to say that if we add it, should also be added for the machine-readable JSON status (from key \xFF\xFF/status/json), but I just realized that there is no dedicated Go API method to fetch it, so that's not a concern.
Pros:
- will be gladly welcome downstream
Cons:
- needs a commitment to be kept up to date every time there is a change
- if there is a breaking change in such JSON format, the Go binding will need an immediate update because otherwise nobody will be able to read any field from it (even if it's not the one affected by the breaking change)
- in case of multiple JSON formats for multiple versions, the Go binding will have to forward-port the older versions of the struct to the new version
I can give this a try, and point out fields whose type I am not sure about; what do you prefer?
Another take at this would be: if we want to support as many versions as possible, we will return the raw values from FoundationDB for all of the special keys (coordinators etc) and never act as a middle-man/translator between client and server. This would extend to the client status information as well.
@johscheuer any idea why in some cases an empty string and no error can be returned? I am trying to reproduce this, but without success so far.
Re-based and added a commit which updates the GoDoc for ReadTransact().
Result of foundationdb-pr-clang-ide on Linux CentOS 7
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:21:41
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang on Linux CentOS 7
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:32:20
- Result: :x: 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)
Result of foundationdb-pr on Linux CentOS 7
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:40:29
- Result: :x: 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)
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:42:18
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang-arm on Linux CentOS 7
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:45:35
- Result: :x: 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)
Result of foundationdb-pr-macos on macOS Ventura 13.x
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:49:51
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
- Commit ID: a93fdaad1a9b2d6040b6f9d6086f59723735046a
- Duration 0:54:20
- Result: :white_check_mark: 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)
@johscheuer sometimes the returned status is an empty string, it is happening also in tests:
--- FAIL: TestGetClientStatus (0.00s)
fdb_test.go:402: returned status is empty
fdb_test.go:404: client status returned:
FAIL
Could this be a race within libfdb?
Edit: I added a dedicated error ErrClientNotReady for this condition, that clients can retry.
Result of foundationdb-pr-clang-ide on Linux CentOS 7
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:23:58
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang on Linux CentOS 7
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:34:14
- Result: :x: 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)
Result of foundationdb-pr on Linux CentOS 7
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:41:55
- Result: :x: 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)
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:42:11
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang-arm on Linux CentOS 7
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:45:42
- Result: :x: 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)
Result of foundationdb-pr-macos on macOS Ventura 13.x
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:49:14
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
- Commit ID: a2b742274a211f2b947ed2246a337a06a6d0ad25
- Duration 0:58:31
- Result: :white_check_mark: 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)
Result of foundationdb-pr-clang-ide on Linux CentOS 7
- Commit ID: 59d2a6cdbc2b71ec734fe5cbe36f0ff6c306d27b
- Duration 0:21:41
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)
Result of foundationdb-pr-clang on Linux CentOS 7
- Commit ID: 59d2a6cdbc2b71ec734fe5cbe36f0ff6c306d27b
- Duration 0:33:18
- Result: :x: 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)
Result of foundationdb-pr on Linux CentOS 7
- Commit ID: 59d2a6cdbc2b71ec734fe5cbe36f0ff6c306d27b
- Duration 0:40:25
- Result: :x: 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)
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
- Commit ID: 59d2a6cdbc2b71ec734fe5cbe36f0ff6c306d27b
- Duration 0:43:26
- Result: :white_check_mark: SUCCEEDED
- Error:
N/A - Build Log terminal output (available for 30 days)
- Build Workspace zip file of the working directory (available for 30 days)