tanruixiang commented on PR #882:
URL: 
https://github.com/apache/incubator-kvrocks/pull/882#issuecomment-1250314669

   > @PragmaTwice @git-hulk @torwig I noticed a problem. In the following 
tests. When we write a value with only one bit(like 'a'). Occasionally, the 
size of the key we get is 0. It occurs frequently when the value is very small. 
I guess the reason for this problem is that sync in writeoption defaults to 
false. Or because the `GetApproximateSizes` can only yield approximate values, 
which may be ignored for small values.
   > 
   > ```
   >   std::vector<int> value_size{1, 1024};
   >   for(auto &p : value_size){
   >     EXPECT_TRUE(string->Set(key_, std::string(p, 'a')).ok());
   >     std::string got_value;
   >     EXPECT_TRUE(string->Get(key_,  &got_value).ok());
   >     EXPECT_EQ(got_value, std::string(p, 'a'));
   >     std::string value;
   >     string->Get(key_, &value);
   >     uint64_t result = 0;
   >     EXPECT_TRUE(disk->GetKeySize(key_, kRedisString, &result).ok());
   >     EXPECT_GE(result, p);
   >   }
   > ```
   
   @git-hulk  Hi. Do you have time to look at this question? Because the 
approximate usage space is obtained, it may encounter a situation of 0 during 
testing. Increasing the sleep time also doesn't completely solve the problem. 
It seems that the sync method is not supported either.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to