-
Notifications
You must be signed in to change notification settings - Fork 473
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
Support DISK Command #882
Support DISK Command #882
Conversation
@PragmaTwice Hi. Do you have any more suggestions on reducing redundant code? |
@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
|
require.GreaterOrEqual(t, val, int(float64(approximateSize)*estimationFactor)) | ||
require.LessOrEqual(t, val, int(float64(approximateSize)/estimationFactor)) |
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.
I am wondering if this could be narrowed down a bit more. This range currently has a hundred times the gap between the upper and lower bound, which I think is still relatively large. But if we can confirm that the estimation accuracy of rocksdb can only be this at most, it is fine.
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.
I think it is theoretically possible, but we need to accurately calculate the key size constructed by kvrocks as the expected size. Also consider rocksdb's space compression for keys (such as prefix compression). In fact, the test of rocksdb is also a relatively large range. I personally don't think it makes much sense to do these jobs, because as long as there is no problem with the rocksdb we depend on, then there will be no problem with this function, If there is a change in the kvrocks level, the scope now is enough to test the problem. Of course, I can give it a try if you feel the need to.
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.
I think it is fine if rocksdb also has a large range.
@git-hulk @torwig @caipengbo Hi. Do you have time to review? |
Sure, I have read through the implementation, and overall is good to me. I'm still wondering if we have a more general way to reduce duplicate codes, I will approve this PR soon if can't figure out a better way. |
Do you have any ideas? It seems like it should be impossible to reduce each type of custom operation. |
The main issue is |
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.
LGTM
@PragmaTwice @caipengbo @torwig Do you have any suggestion on this PR? Or I will merge it if we have no further comment. |
LGTM |
Thanks for @tanruixiang contribution and patient, also thanks to everyone who reviewed this PR. Merging... |
We also need to update our website :) @git-hulk |
Yes, @caipengbo you can help to update as well when you're free. https://github.com/apache/incubator-kvrocks-website/blob/main/docs/01-supported-commands.md |
If I update the repository, will the site automatically update? |
Do you want to do it? If you don't have time, I can update the website later today. |
Yes, GitHub actions will deploy the update automatically. |
Cool, thanks. @tanruixiang |
Yes, you can do it :) @tanruixiang |
It closes #874