Skip to content
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

Align rejected unblocked commands to update the correct error statistic #577

Open
wants to merge 7 commits into
base: unstable
Choose a base branch
from

Conversation

ranshid
Copy link
Member

@ranshid ranshid commented May 30, 2024

Currently, in case a blocked command is unblocked externally (eg. due to the relevant slot being migrated or the CLIENT UNBLOCK command was issued, the command statistics will always update the failed_calls error statistic. This leads to missalignment with 90b9f08 as well as some inconsistencies. For example when a key is migrated during cluster slot migration, clients blocked on XREADGROUP will be unblocked and update the rejected_calls stat, while clients blocked on BLPOP will get unblocked updating the failed_calls stat.

In this PR we add explicit indication in updateStatsOnUnblock thet indicates if the command was rejected or failed.

Currently, in case a blocked command is unblocked externally (eg. due
to the relevant slot being migrated or the CLIENT UNBLOCK command was
issued, the command statistics will always update the failed_calls error
statistic. This leads to missalignment with valkey-io@90b9f08
as well as some inconsistencies. For example when a key is migrated
during cluster slot migration, clients blocked on XREADGROUP will be
unblocked and update the rejected_calls stat, while clients blocked on
BLPOP will get unblocked updating the failed_calls stat.

In this PR we add explicit indication in updateStatsOnUnblock thet
indicates if the command was rejected or failed.

Signed-off-by: ranshid <[email protected]>
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 70.20%. Comparing base (6bab2d7) to head (0b265c7).
Report is 3 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #577      +/-   ##
============================================
+ Coverage     70.07%   70.20%   +0.12%     
============================================
  Files           109      109              
  Lines         59956    59961       +5     
============================================
+ Hits          42016    42093      +77     
+ Misses        17940    17868      -72     
Files Coverage Δ
src/blocked.c 90.90% <83.33%> (-0.97%) ⬇️
src/module.c 9.65% <0.00%> (-0.01%) ⬇️

... and 11 files with indirect coverage changes

ranshid added 4 commits May 31, 2024 04:42
Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
Signed-off-by: ranshid <[email protected]>
@madolson
Copy link
Member

madolson commented Oct 7, 2024

@ranshid Can you update this? I remember discussing this but I guess it fell between the cracks.

@madolson madolson requested a review from hpatro November 22, 2024 03:29
@hpatro
Copy link
Contributor

hpatro commented Nov 26, 2024

Can you update this? I remember discussing this but I guess it fell between the cracks.

I don't have the context. @ranshid What's remaining here?

src/blocked.c Show resolved Hide resolved
@ranshid
Copy link
Member Author

ranshid commented Dec 11, 2024

@madolson @hpatro so sorry I missed that one. It is something I already did in Redis OSS and wanted to port it here.
rebased and applied @hpatro suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants