Skip to content

Conversation

stephanie-wang
Copy link
Contributor

@stephanie-wang stephanie-wang commented Oct 27, 2020

Why are these changes needed?

This adds a local object manager class with unit tests to the raylet to improve code maintainability. This class is responsible for maintaining any primary object copies in the local plasma store, freeing these objects when appropriate, and coordinating spilling and restoring objects to and from external storage.

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@stephanie-wang stephanie-wang changed the title [Object spilling] Add a local object manager class to the raylet [Object spilling] Refactor raylet to add a local object manager class Oct 27, 2020
Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

LGTM! Just a few really minor comments :)


private:
/// Delete freed objects.
void Flush();
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we planning to spill those freed objects later within this method? The function name is a little confusing to me (because as far as I know flush means you'd like to move buffered objects onto the durable storage).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually just triggers the callback for freed objects. It doesn't have anything to do with spilling. I'll update the name and description.

if (!status.ok()) {
RAY_LOG(WARNING) << "Worker failed. Unpinning object " << object_id;
}
RAY_LOG(DEBUG) << "Unpinning object " << object_id;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we take out these logic into a different private method like FreePinnedObjects? It was a little confusing to me that Pin objects method also unpin objects.

ASSERT_EQ(num_times_fired, 1);
for (size_t i = 0; i < object_ids.size(); i++) {
ASSERT_EQ(object_table.object_urls[object_ids[i]], urls[i]);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like AsyncRestoreSpilledObject is not tested here. Are you planning to add it in the follow-up PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I didn't add it because there isn't that much to test...but yeah let me add a unit test for it.

Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

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

👍

@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Oct 27, 2020
Co-authored-by: Eric Liang <ekhliang@gmail.com>
@stephanie-wang stephanie-wang removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Oct 28, 2020
@stephanie-wang stephanie-wang merged commit 427b5af into ray-project:master Oct 28, 2020
@stephanie-wang stephanie-wang deleted the object-refactor branch October 28, 2020 14:38
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