-
Notifications
You must be signed in to change notification settings - Fork 1k
HSETEX - Always issue keyspace notifications after validation #3001
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
base: unstable
Are you sure you want to change the base?
HSETEX - Always issue keyspace notifications after validation #3001
Conversation
Signed-off-by: Ran Shidlansik <[email protected]>
|
currently making this a draft for when #2998 is merged |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3001 +/- ##
============================================
- Coverage 74.93% 74.86% -0.07%
============================================
Files 129 129
Lines 71145 71147 +2
============================================
- Hits 53310 53264 -46
- Misses 17835 17883 +48
🚀 New features to boost your workflow:
|
…ort-keyspace-events Signed-off-by: Ran Shidlansik <[email protected]>
|
So, I guess we either:
Do we have a preference between those two? |
TBH I am not sure how much this new feature adoption is big so I would love to make it ASAP. |
Signed-off-by: Ran Shidlansik <[email protected]>
| } | ||
| } | ||
|
|
||
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.
Signed-off-by: Ran Shidlansik <[email protected]>
…ort-keyspace-events
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
Signed-off-by: Ran Shidlansik <[email protected]>
…ort-keyspace-events
…3120) The test is currently flakey, because until we merge: #3001 when the expiration time provided is in the past, and the field does not exist the HSETX will just silently ignore it, without incrementing the statistics. I prefer to focus on writing a dedicated test for: #3001 and deflake this test now. Signed-off-by: Ran Shidlansik <[email protected]>
…alkey-io#3120) The test is currently flakey, because until we merge: valkey-io#3001 when the expiration time provided is in the past, and the field does not exist the HSETX will just silently ignore it, without incrementing the statistics. I prefer to focus on writing a dedicated test for: valkey-io#3001 and deflake this test now. Signed-off-by: Ran Shidlansik <[email protected]>
…alkey-io#3120) The test is currently flakey, because until we merge: valkey-io#3001 when the expiration time provided is in the past, and the field does not exist the HSETX will just silently ignore it, without incrementing the statistics. I prefer to focus on writing a dedicated test for: valkey-io#3001 and deflake this test now. Signed-off-by: Ran Shidlansik <[email protected]>
…alkey-io#3120) The test is currently flakey, because until we merge: valkey-io#3001 when the expiration time provided is in the past, and the field does not exist the HSETX will just silently ignore it, without incrementing the statistics. I prefer to focus on writing a dedicated test for: valkey-io#3001 and deflake this test now. Signed-off-by: Ran Shidlansik <[email protected]>
madolson
left a comment
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 this is right, and is worth backporting and calling out as a bug fix.
In the original implementation of Hash Field Expiration (#2089), the HSETEX command was implemented to report keyspace notifications only for performed changes. This is mostly aligned with other Hash commands (for example, HDEL will also not report
hdelevent for items which does not exist)The HSETEX case is somewhat different and is more like the
HSETcase. During HSETEX, after the command validations pass, items are ALWAYS "added" to the object, even though they might not actually be added.This case is the same for when the hash object is empty or when all the provided fields do not exist in the object (as reported here)
This PR changes the way
HSETEXwill report keyspace notifications so that:hsetnotification will ALWAYS be reported if all command validations pass.hexpirewill be reported in case the command include an expiration time (even past time)hxpiredwill be reported in case the provided expiration time is in the past (or 0)hdelwill be reported in case the hash exists (or created as part of the command) and following the command execution it was left empty.