valkey icon indicating copy to clipboard operation
valkey copied to clipboard

Align rejected unblocked commands to update the correct error statistic

Open ranshid opened this issue 1 year ago • 2 comments

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 https://github.com/valkey-io/valkey/commit/90b9f08e5d1657e7bfffe43f31f6663bf469ee75 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.

ranshid avatar May 30 '24 17:05 ranshid

Codecov Report

Attention: Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 70.78%. Comparing base (1acf7f7) to head (cd859c4). Report is 41 commits behind head on unstable.

Files with missing lines Patch % Lines
src/blocked.c 63.63% 4 Missing :warning:
src/module.c 0.00% 3 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #577      +/-   ##
============================================
+ Coverage     70.71%   70.78%   +0.07%     
============================================
  Files           119      119              
  Lines         64652    64699      +47     
============================================
+ Hits          45717    45800      +83     
+ Misses        18935    18899      -36     
Files with missing lines Coverage Δ
src/server.h 100.00% <ø> (ø)
src/module.c 9.61% <0.00%> (-0.03%) :arrow_down:
src/blocked.c 91.11% <63.63%> (-0.78%) :arrow_down:

... and 51 files with indirect coverage changes

codecov[bot] avatar May 30 '24 17:05 codecov[bot]

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

madolson avatar Oct 07 '24 23:10 madolson

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?

hpatro avatar Nov 26 '24 17:11 hpatro

@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.

ranshid avatar Dec 11 '24 16:12 ranshid

This is a minor change in behavior. @madolson Do you folks vote on this as well?

hpatro avatar Dec 17 '24 18:12 hpatro