Skip to content

Conversation

@soloestoy
Copy link
Member

@soloestoy soloestoy commented Jul 24, 2025

introduce negative filters for CLIENT LIST and CLIENT KILL commands:

  1. NOT-ID: Excludes clients in the IDs set
  2. NOT-TYPE: Excludes clients of the specified type
  3. NOT-ADDR: Excludes clients of the specified address and port
  4. NOT-LADDR: Excludes clients connected to the specified local address and port
  5. NOT-USER: Excludes clients of the specified user
  6. NOT-FLAGS: Excludes clients with the specified flag string
  7. NOT-NAME: Excludes clients with the specified name
  8. NOT-LIB-NAME: Excludes clients using the specified library name
  9. NOT-LIB-VER: Excludes clients with the specified library version
  10. NOT-DB: Excludes clients with the specified database ID
  11. NOT-CAPA: Excludes clients with the specified capabilities
  12. NOT-IP: Excludes clients with the specified IP address

close #1936

and fix the matching algorithm for flag 'N'.

@soloestoy soloestoy requested review from a team, hpatro and sarthakaggarwal97 July 24, 2025 09:33
@soloestoy soloestoy moved this to In Progress in Valkey 9.0 Jul 24, 2025
Signed-off-by: zhaozhao.zz <[email protected]>
@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 88.99083% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.53%. Comparing base (de76586) to head (41b1325).
⚠️ Report is 23 commits behind head on unstable.

Files with missing lines Patch % Lines
src/networking.c 88.99% 12 Missing ⚠️
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     
Files with missing lines Coverage Δ
src/commands.def 100.00% <ø> (ø)
src/networking.c 88.24% <88.99%> (+0.08%) ⬆️

... and 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PingXie PingXie requested a review from Copilot July 28, 2025 02:46
Copy link

Copilot AI left a 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

Copy link
Member

@madolson madolson left a 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.

Copy link
Member

@madolson madolson left a 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!

@madolson madolson added the release-notes This issue should get a line item in the release notes label Jul 31, 2025
@sarthakaggarwal97 sarthakaggarwal97 added the needs-doc-pr This change needs to update a documentation page. Remove label once doc PR is open. label Jul 31, 2025
@sarthakaggarwal97
Copy link
Contributor

@soloestoy it will need similar changes like #2362 right?

@soloestoy soloestoy merged commit 1fbf5fb into valkey-io:unstable Aug 1, 2025
53 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Valkey 9.0 Aug 1, 2025
@soloestoy
Copy link
Member Author

@soloestoy it will need similar changes like #2362 right?

it would introduce breaking change and needs further discussion, we can decide later

@madolson madolson added the major-decision-approved Major decision approved by TSC team label Aug 4, 2025
zuiderkwast added a commit to valkey-io/valkey-doc that referenced this pull request Sep 8, 2025
for valkey-io/valkey#2378

---------

Signed-off-by: zhaozhao.zz <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major-decision-approved Major decision approved by TSC team needs-doc-pr This change needs to update a documentation page. Remove label once doc PR is open. release-notes This issue should get a line item in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[NEW] Negative filtering for client command filters

4 participants