Skip to content

Fix INFO all/default/everything returning empty response#1645

Merged
vazois merged 8 commits intomainfrom
vazois/fix-info-all-default-everything
Mar 26, 2026
Merged

Fix INFO all/default/everything returning empty response#1645
vazois merged 8 commits intomainfrom
vazois/fix-info-all-default-everything

Conversation

@vazois
Copy link
Copy Markdown
Contributor

@vazois vazois commented Mar 24, 2026

Summary

Fixes #1643

\INFO all\ was returning an empty response because the \ALL\ keyword was recognized but skipped without adding any sections to the result set.

Changes

\GarnetInfoMetrics.cs\

  • Added \AllInfoSet\ — a \HashSet\ derived from \DefaultInfo\ excluding \MODULES\
  • Added \EverythingInfoSet\ — a \HashSet\ containing all \DefaultInfo\ sections (including \MODULES)

\InfoCommand.cs\

  • \ALL\ now calls \sections.UnionWith(GarnetInfoMetrics.AllInfoSet)\ instead of being silently skipped
  • Added handling for \DEFAULT\ and \EVERYTHING\ keywords using their respective HashSets

\InfoHelp.cs\

  • Added \DEFAULT\ and \EVERYTHING\ constants and updated help message descriptions

\RespInfoTests.cs\

  • \InfoSectionOptionsTest: parameterized test verifying ALL/DEFAULT/EVERYTHING return correct sections
  • \InfoDefaultMatchesNoArgsTest: verifies \INFO DEFAULT\ returns the same sections as \INFO\ (no args)
  • \InfoAllWithModulesEqualsEverythingTest: verifies \INFO ALL MODULES\ equals \INFO EVERYTHING\

Behavior

Option Sections included
\default\ (or no arg) DefaultInfo (excludes expensive: STOREHASHTABLE, OBJECTSTOREHASHTABLE, STOREREVIV, OBJECTSTOREREVIV, HLOGSCAN)
\�ll\ DefaultInfo minus MODULES
\�verything\ DefaultInfo (all default sections including MODULES)

Implement support for INFO all, default, and everything options:
- all: returns all DefaultInfo sections excluding module-generated ones
- default: returns the default set of sections (same as no-arg INFO)
- everything: returns all DefaultInfo sections including modules

Added pre-declared HashSet collections (AllInfoSet, EverythingInfoSet)
in GarnetInfoMetrics.cs derived from DefaultInfo to support these options.

Updated InfoCommand.cs to use UnionWith with the new HashSets instead of
silently skipping the ALL keyword.

Added tests for all three options, verifying correct section inclusion/exclusion.

Fixes #1643

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 24, 2026 20:45
Copy link
Copy Markdown
Contributor

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

Fixes Garnet’s INFO command option handling so INFO ALL (and new DEFAULT / EVERYTHING keywords) return populated section output rather than an empty response, improving Redis-client/tool compatibility.

Changes:

  • Added predefined section sets in GarnetInfoMetrics to back ALL and EVERYTHING.
  • Updated INFO command parsing to union in the correct sections for ALL/DEFAULT/EVERYTHING.
  • Expanded help text and added tests covering the new/updated option behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
libs/server/Metrics/Info/GarnetInfoMetrics.cs Introduces section sets used by INFO option keywords.
libs/server/Metrics/Info/InfoCommand.cs Implements keyword parsing so ALL/DEFAULT/EVERYTHING select sections instead of being skipped.
libs/server/Metrics/Info/InfoHelp.cs Updates INFO HELP output to document new/changed keywords.
test/Garnet.test/RespInfoTests.cs Adds coverage for INFO option keywords and equivalence checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

vazois and others added 3 commits March 24, 2026 13:57
Adds explicit asserts before splitting INFO output so test failures
surface a clear message instead of a NullReferenceException.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vazois vazois force-pushed the vazois/fix-info-all-default-everything branch from 1d57a91 to 7220dd3 Compare March 25, 2026 20:55
@vazois vazois force-pushed the vazois/fix-info-all-default-everything branch from 4222d4f to 35891c1 Compare March 25, 2026 22:51
@vazois vazois merged commit b774d07 into main Mar 26, 2026
34 checks passed
@vazois vazois deleted the vazois/fix-info-all-default-everything branch March 26, 2026 21:23
vazois added a commit that referenced this pull request Mar 27, 2026
* Fix INFO all/default/everything returning empty response

Implement support for INFO all, default, and everything options:
- all: returns all DefaultInfo sections excluding module-generated ones
- default: returns the default set of sections (same as no-arg INFO)
- everything: returns all DefaultInfo sections including modules

Added pre-declared HashSet collections (AllInfoSet, EverythingInfoSet)
in GarnetInfoMetrics.cs derived from DefaultInfo to support these options.

Updated InfoCommand.cs to use UnionWith with the new HashSets instead of
silently skipping the ALL keyword.

Added tests for all three options, verifying correct section inclusion/exclusion.

Fixes #1643

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* make everything option use DefaultInfo

* Add null/empty guard in GetSectionHeaders test helper

Adds explicit asserts before splitting INFO output so test failures
surface a clear message instead of a NullReferenceException.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* wip; restructuring cluster tests to reduce CI duration

* separate dispose from close and configure socket to allow rapid connect

* ensure socket is disposed succesfully

* fix failing test

* update global.json

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

INFO all returns empty response — breaks compatibility with monitoring tools (Netdata, etc.)

3 participants