-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go binding: add GetClientStatus method to Database #11627
base: main
Are you sure you want to change the base?
Conversation
63c1ccc
to
6e6cc68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, do you think it make sense to have a go struct that can be used to deserialize the result?
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
I was going to say that if we add it, should also be added for the machine-readable JSON status (from key Pros:
Cons:
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. |
39ad203
to
a93fdaa
Compare
Re-based and added a commit which updates the GoDoc for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
68e39fa
to
59d2a6c
Compare
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
Thanks for triggering the CI; it is still failing, I think I begin to understand what's happening. The C client library has logic to seed an internal The get client status function will perform some magic and in one case can return empty string: ThreadFuture<Standalone<StringRef>> MultiVersionDatabase::getClientStatus() {
auto stateRef = dbState;
auto db = stateRef->dbVar->get();
if (!db.value.isValid()) {
db.value = stateRef->versionMonitorDb;
}
if (!db.value.isValid()) {
return onMainThread([stateRef] { return Future<Standalone<StringRef>>(stateRef->getClientStatus(""_sr)); });
} else { So I believe that for some reason neither databases are considered valid. |
2c09aab
to
08d29e0
Compare
Mention that R/O transactions are garbage-collected once futures go out of scope.
Allow fetching client status JSON information for any database; the raw JSON is returned, so that multiple versions of FoundationDB are supported without any Go structure constraint. There is no specific API version validation as calling this function will work with any multi-version client.
08d29e0
to
e825468
Compare
The reason turned out to be: multi-version client must be enabled in order for this function call to return non-empty string. I have updated the PR accordingly; what's left to figure out is whether I can cover both scenarios in tests (MVC enabled/disabled). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Add
GetClientStatus
method toDatabase
.Allow fetching client status JSON information for any database.
Added a test to make sure that it works with an open database.
By looking in
fdbclient/MultiVersionTransaction.actor.cpp
I found out thatfdb_database_get_client_status()
will return an empty string when the db is invalid; I will document this in this same PR.Related: #11621
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.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branch
ormain
if this is the youngest branch)