-
Notifications
You must be signed in to change notification settings - Fork 948
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
chore: hset family replies and trim #3748
Conversation
1879deb
to
f628bca
Compare
Signed-off-by: Vladislav <[email protected]> Signed-off-by: Vladislav Oleshko <[email protected]>
f628bca
to
7b9c55d
Compare
DCHECK(dynamic_cast<RedisReplyBuilder*>(cntx->reply_builder())); | ||
} | ||
|
||
template <typename T> void Send(OpResult<T> res) { |
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 remember you added a similar approach on Sets
(although it was not the exact same logic). What I don't remember if you added this on another family. If you did check if there is simlar logic and extract it into a base class which we can the reuse among families with this exact same pattern of replies (if they exist in the first place).
} else { | ||
cntx->SendError(result.status()); | ||
} | ||
HSetReplies{cntx}.Send(cntx->transaction->ScheduleSingleHopT(cb)); |
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.
also here if key not found should return 0 and not key not found
maybe also add a unit test for this and hdel
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.
oh I see that this logic for hlen is in the OpLen implementation, this is confusing, I would add this logic to OpDel as well instead of the change in line 781
cntx->SendError(result.status()); | ||
} | ||
if (result.status() == OpStatus::KEY_NOTFOUND) | ||
result = OpResult<uint32_t>(0); |
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.
can you add unit test for this please
No description provided.