roohitavaf/DKVF

byte[] value != ByteString.copyFrom(value).toByteArray()

Closed this issue · 3 comments

wdd00 commented

Hi Mohammad,

I found a problem in this framework. In the eventual consistency protocol, I print the value which is one of arguments of put function and the return value of get function in EventualClient class into log. For the same key, two values are different. In other words, the get operation returns a value which is not inserted by any put operation.

I also try to compare the value which is one of the arguments of put function with ByteString.copyFrom(value).toByteArray(). They are not same. Could you take a look at this problem? Or maybe I did something wrong.

Best,
Dandan Wang.

You mean writing and reading from the same replica? or different replicas?
What are the values?

wdd00 commented

Yes, write and read from the same replica. Take the eventual consistency protocol as the example. I print the <key, value> pair into the client's log. In the function put, I add protocolLOGGER.info("PUT " + key + " " + value);. In the function get, I add protocolLOGGER.info("GET " + key + " " + cr.getGetReply().getValue().toByteArray());. I construct the same cluster as you instructed in Youtube. Here are the two clients' logs:
Picture1
Picture2

The key "user8517097267634966620" is updated by both clients. The values are "[B@5da9d0f0]" and "[B@5671dba5]". However, the following GET operations get some values of this key. And these values are not consistent with any updated values by PUT operations before.

Then I tried to print the whole message "Record" directly instead of transferring the value in Record into string. In the function put, I add protocolLOGGER.info("PUT " + pm.toString());. In the function get, I add protocolLOGGER.info("GET " + key + " " + cr.getGetReply().toString());.

Picture3
Picture4

Now, we can get the values (with type byte[]) updated by PUT operations.

So your issue is resolved? if yes, please close the issue.