v6d-io / v6d

vineyard (v6d): an in-memory immutable data manager. (Project under CNCF, TAG-Storage)
https://v6d.io
Apache License 2.0
816 stars 117 forks source link

If the object is deleted when the client migrates it, the client will read the invalid value #1927

Open vegetableysm opened 1 week ago

vegetableysm commented 1 week ago

Describe your problem

As tittled, example:

  1. IPCClient create a object (object id is id1)
  2. RPCClient get object with id1, and get blob with object meta
  3. RPCClient call getRemoteBlob to get blob
  4. Before Vineyardd send blob data, vineyard sleep 5 second.
  5. IPCClient call delData to delete the object and create a new object with new data
  6. Vineyard wakes, and sends buffer.
  7. RPCClient get blob data.

I think the rpc client should get the error status because the object has been deleted. Or vineyardd should refuse to delete the object being migrated during migration. However, rpc client get the new data from vineyardd.

Screen shot Create object with data {1.0, 7.0, 3.0, 4.0, 2.0} and delete it, then create object with data {11, 23, 34, 45, 56} image Check will failed because rpc client use the old blob id and read new data with {11, 23, 34, 45, 56}

Test code has been pushed at https://github.com/vegetableysm/v6d/tree/test-rpc-with-del