-
Notifications
You must be signed in to change notification settings - Fork 955
support negative filtering for client command filters #2378
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 negative filtering for client command filters #2378
Conversation
Signed-off-by: zhaozhao.zz <[email protected]>
Signed-off-by: zhaozhao.zz <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #2378 +/- ##
============================================
+ Coverage 71.41% 71.53% +0.11%
============================================
Files 123 123
Lines 67132 67282 +150
============================================
+ Hits 47942 48129 +187
+ Misses 19190 19153 -37
🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR introduces comprehensive negative filtering support for CLIENT LIST and CLIENT KILL commands, adding 14 new NOT-* filter types that exclude clients matching specified criteria instead of including them. The implementation allows combining positive and negative filters for more granular client management.
Key changes:
- Added 14 new negative filter types (NOT-ID, NOT-MAXAGE, NOT-TYPE, etc.) for both CLIENT LIST and CLIENT KILL commands
- Extended the clientFilter structure to support parallel negative filtering fields
- Updated command documentation and argument definitions to reflect the new capabilities
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/networking.c | Core implementation of negative filtering logic in clientFilter struct and parsing/matching functions |
| tests/unit/introspection.tcl | Comprehensive test coverage for all new negative filter types and combinations |
| src/commands/client-list.json | Command specification updates for CLIENT LIST negative filters |
| src/commands/client-kill.json | Command specification updates for CLIENT KILL negative filters |
| src/commands.def | Command definition updates including argument counts and structures |
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.
One high level comment, but the code looked mostly good. I liked some of the other improvements you made as well.
Signed-off-by: zhaozhao.zz <[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'm good, thanks!
|
@soloestoy it will need similar changes like #2362 right? |
it would introduce breaking change and needs further discussion, we can decide later |
for valkey-io/valkey#2378 --------- Signed-off-by: zhaozhao.zz <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
introduce negative filters for
CLIENT LISTandCLIENT KILLcommands:NOT-ID: Excludes clients in the IDs setNOT-TYPE: Excludes clients of the specified typeNOT-ADDR: Excludes clients of the specified address and portNOT-LADDR: Excludes clients connected to the specified local address and portNOT-USER: Excludes clients of the specified userNOT-FLAGS: Excludes clients with the specified flag stringNOT-NAME: Excludes clients with the specified nameNOT-LIB-NAME: Excludes clients using the specified library nameNOT-LIB-VER: Excludes clients with the specified library versionNOT-DB: Excludes clients with the specified database IDNOT-CAPA: Excludes clients with the specified capabilitiesNOT-IP: Excludes clients with the specified IP addressclose #1936
and fix the matching algorithm for flag 'N'.