-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ARROW-3958: [Plasma] Reduce number of IPCs #3124
Changes from 1 commit
24beb27
5f09199
e5ccbba
cfff7e3
2887b17
502aeda
f60dcbe
0d57282
71c4c5c
af150c1
a038404
f899f45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,15 +82,18 @@ class TestPlasmaStore : public ::testing::Test { | |
|
||
void CreateObject(PlasmaClient& client, const ObjectID& object_id, | ||
const std::vector<uint8_t>& metadata, | ||
const std::vector<uint8_t>& data) { | ||
const std::vector<uint8_t>& data, | ||
bool release = true) { | ||
std::shared_ptr<Buffer> data_buffer; | ||
ARROW_CHECK_OK(client.Create(object_id, data.size(), &metadata[0], metadata.size(), | ||
&data_buffer)); | ||
for (size_t i = 0; i < data.size(); i++) { | ||
data_buffer->mutable_data()[i] = data[i]; | ||
} | ||
ARROW_CHECK_OK(client.Seal(object_id)); | ||
ARROW_CHECK_OK(client.Release(object_id)); | ||
if (release) { | ||
ARROW_CHECK_OK(client.Release(object_id)); | ||
} | ||
} | ||
|
||
const std::string& GetStoreSocketName() const { return store_socket_name_; } | ||
|
@@ -155,11 +158,12 @@ TEST_F(TestPlasmaStore, SealErrorsTest) { | |
|
||
// Create object. | ||
std::vector<uint8_t> data(100, 0); | ||
CreateObject(client_, object_id, {42}, data); | ||
CreateObject(client_, object_id, {42}, data, false); | ||
|
||
// Trying to seal it again. | ||
result = client_.Seal(object_id); | ||
ASSERT_TRUE(result.IsPlasmaObjectAlreadySealed()); | ||
ARROW_CHECK_OK(client_.Release(object_id)); | ||
} | ||
|
||
TEST_F(TestPlasmaStore, DeleteTest) { | ||
|
@@ -228,13 +232,7 @@ TEST_F(TestPlasmaStore, DeleteObjectsTest) { | |
// client2_ won't send the release request immediately because the trigger | ||
// condition is not reached. The release is only added to release cache. | ||
object_buffers.clear(); | ||
// The reference count went to zero, but the objects are still in the release | ||
// cache. | ||
ARROW_CHECK_OK(client_.Contains(object_id1, &has_object)); | ||
ASSERT_TRUE(has_object); | ||
ARROW_CHECK_OK(client_.Contains(object_id2, &has_object)); | ||
ASSERT_TRUE(has_object); | ||
// The Delete call will flush release cache and send the Delete request. | ||
// Delete the objects. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is not needed any more (there is no release cache any more) |
||
result = client2_.Delete(std::vector<ObjectID>{object_id1, object_id2}); | ||
ARROW_CHECK_OK(client_.Contains(object_id1, &has_object)); | ||
ASSERT_FALSE(has_object); | ||
|
@@ -386,7 +384,6 @@ TEST_F(TestPlasmaStore, AbortTest) { | |
// Test that we can get the object. | ||
ARROW_CHECK_OK(client_.Get({object_id}, -1, &object_buffers)); | ||
AssertObjectBufferEqual(object_buffers[0], {42, 43}, {1, 2, 3, 4, 5}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following line was a bug masked by the release cache. This form of get calls Release in the destructor of the PlasmaBuffer shared pointer. |
||
ARROW_CHECK_OK(client_.Release(object_id)); | ||
} | ||
|
||
TEST_F(TestPlasmaStore, MultipleClientTest) { | ||
|
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.
This was a bug that was masked by the release_delay before. If we call Release before the second Seal, the result status will be "PlasmaObjectNonexistent" instead of "PlasmaObjectAlreadySealed".