-
Notifications
You must be signed in to change notification settings - Fork 472
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 for the BITFIELD command #1901
Conversation
f4bf982
to
5598089
Compare
5598089
to
1b64a04
Compare
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.
Ooops seems this patch is extremly huge...I need take time for review, just some tiny comments first.
@julic20s Can use |
Sorry, I didn't see it at first, I just used shortcut formatting in the ide |
ooh, that's fine. You can also configure clang-format in IDE if supported. |
9b3fb4a
to
fea8910
Compare
Thanks @julic20s . This patch is huge, and I need some time to review the whole patch. I just submit some small comments. |
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.
Thanks for your contribution!
Just some random thoughts without going into the details.
Besides, I believe it would be beneficial to create golang test cases for the recently added command.
The mutex pool in lock manager may be reallocated by MultiGet(). Then the old mutex pointers in LockGuard all be invalid...I guess that's why I failed the test. Should I use a std::deque to replace the vector? |
@julic20s Guess not, you should use refer: kvrocks/src/types/redis_set.cc Line 205 in a188009
|
Thanks, I get it. The actual cause is that I define a default move assignment function, which cause a dangling pointer.
…________________________________
发件人: hulk ***@***.***>
发送时间: 2023年11月22日 16:30
收件人: apache/kvrocks ***@***.***>
抄送: julic20s ***@***.***>; Mention ***@***.***>
主题: Re: [apache/kvrocks] Support for the BITFIELD command (PR #1901)
@julic20s<https://github.com/julic20s> Guess not, you should use std::optional<LockGuard> instead of LockGuard directly since the LockGuard constructor will lock the mutex, and if you use LockGuard = default, it won't lock the mutex at all.
―
Reply to this email directly, view it on GitHub<#1901 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AXIOCT53WTNNJLK4GF5RTLTYFWZ2VAVCNFSM6AAAAAA7TG4R22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRSGMYTINRWHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
LockGuard(LockGuard &&guard) : lock_(guard.lock_) { guard.lock_ = nullptr; } // correct constructor
LockGuard &operator=(LockGuard &&other) = default; // uncorrect assignment. 😭 |
@julic20s BTW, would you like to take anonymous functions(get/set/get_segment) from Bitmap::bitfield into named functions. This function is a bit hard to read for now. |
I'm a bit busy on workdays, I'll go through a pass this weekend. If other thinks it's ok we can review an merge it first |
791478f
to
cf1921f
Compare
@git-hulk Could you help me approval the workflow? I fix some problems that I found. But I can't reproduction the unittest failed on my local machine. I tried both gcc and clang. |
done |
I am trying to use rocksdb::PinnableSlice to improve Bitmap::SegmentCacheStore. But I failed because of some strange error. When I use |
I don't think using PinnableSlice is necessary for this PR to be merged. |
c2a6565
to
289d25b
Compare
@mapleFU Hi, I finished all changes you pointed, could you review them again? Thanks. |
Sure, I'm now becoming very busy on workdays, I'll finish review these few days. |
ac8a4fd
to
c696718
Compare
@PragmaTwice @mapleFU I think we can go ahead to merge this PR if overall looks good. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Thank you for your contribution! |
#1896