Skip to content

Implement the client table for the new GCS #1674

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

Merged
merged 13 commits into from
Mar 12, 2018

Conversation

stephanie-wang
Copy link
Contributor

What do these changes do?

This adds a client table to the GCS, with pubsub functionality for new and deleted clients. After attaching the AsyncGcsClient to an event loop, the caller should call ClientTable::Connect() to notify others of its client information.

Upon connection, the client will receive notifications about all other clients and whether they are alive or dead. Notifications may be duplicated but are delivered in order for idempotency. For convenience, these notifications are cached in the ClientTable. Once a client has disconnected, its death will be published to all other clients, and it should not reconnect with the same client ID.

@stephanie-wang stephanie-wang requested a review from pcmoritz March 7, 2018 23:37
@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4191/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4192/
Test PASSed.

// duplicate notifications.
if (client_data->is_insertion() &&
RedisModule_KeyType(clients_key) != REDISMODULE_KEYTYPE_EMPTY) {
// NOTE(swang): Sets are not implemented yet, so we use ZSETs instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the main data in the GCS we want to get rid of redis datastructure (e.g. for flushing or if somebody wants to use a different system for the GCS); for the client tables it's ok I think since it is very small and won't get flushed (and probably will move into etcd at some point), but for the other tables let's keep it in mind.

cc @concretevitamin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. If we want to remove the data structure from the server for the client table, we can go back to the design where a client scans the client table when it first subscribes. I just did not do that here since we don't have a "scan" API for the new GCS client.

Copy link
Contributor

@pcmoritz pcmoritz left a comment

Choose a reason for hiding this comment

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

LGTM, we can merge after the tests pass!

@elibol
Copy link
Contributor

elibol commented Mar 9, 2018

I merged master into this branch and resolved conflicts. The major conflicts were with tables.h and tables.cc. I merged by accepting the versions of those files from this branch. I kept task_table.cc to be consistent with the changes in this branch.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4223/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4224/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4225/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4236/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4255/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4257/
Test PASSed.

RAY_CHECK(!client_id.is_nil());
auto entry = client_cache_.find(client_id);
if (entry != client_cache_.end()) {
return entry->second;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this include a check for entry->second.is_insertion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it includes clients that have disconnected.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4259/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4260/
Test PASSed.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/4261/
Test PASSed.

@stephanie-wang stephanie-wang merged commit 6114b6d into ray-project:master Mar 12, 2018
@stephanie-wang
Copy link
Contributor Author

Added a couple fixes for some memory issues I was seeing in client_tests.cc. Let's try to add valgrind for these tests soon, @pcmoritz?

@stephanie-wang stephanie-wang deleted the client-table branch March 12, 2018 02:18
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.

4 participants