You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/09/18 14:45:33 UTC

[GitHub] [incubator-kvrocks] git-hulk commented on pull request #882: Support DISK Command

git-hulk commented on PR #882:
URL: https://github.com/apache/incubator-kvrocks/pull/882#issuecomment-1250323852

   > > @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.
   
   Did you enable the `include_memtabtles` in SizeApproximationOptions? 


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org