Unverified Commit eedb8b17 authored by Shay Fadida's avatar Shay Fadida Committed by GitHub
Browse files

Fix missing sections for INFO ALL with module (#11291)



When using `INFO ALL <section>`, when `section` is a specific module section. 
Redis will not print the additional section(s).

The fix in this case, will search the modules info sections if the user provided additional sections to `ALL`.
Co-authored-by: default avatarOran Agra <oran@redislabs.com>
parent c2b0c13d
...@@ -6010,9 +6010,13 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { ...@@ -6010,9 +6010,13 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
} }
/* Get info from modules. /* Get info from modules.
* if user asked for "everything" or "modules", or a specific section * Returned when the user asked for "everything", "modules", or a specific module section.
* that's not found yet. */ * We're not aware of the module section names here, and we rather avoid the search when we can.
if (everything || dictFind(section_dict, "modules") != NULL || sections < (int)dictSize(section_dict)) { * so we proceed if there's a requested section name that's not found yet, or when the user asked
* for "all" with any additional section names. */
if (everything || dictFind(section_dict, "modules") != NULL || sections < (int)dictSize(section_dict) ||
(all_sections && dictSize(section_dict)))
{
info = modulesCollectInfo(info, info = modulesCollectInfo(info,
everything || dictFind(section_dict, "modules") != NULL ? NULL: section_dict, everything || dictFind(section_dict, "modules") != NULL ? NULL: section_dict,
......
...@@ -44,6 +44,14 @@ start_server {tags {"modules"}} { ...@@ -44,6 +44,14 @@ start_server {tags {"modules"}} {
assert { [string match "*used_memory*" $info] } assert { [string match "*used_memory*" $info] }
} }
test {module info all infotest} {
set info [r info all infotest]
# info all infotest should contain both ALL and the module information
assert { [string match "*Spanish*" $info] }
assert { [string match "*infotest_*" $info] }
assert { [string match "*used_memory*" $info] }
}
test {module info everything} { test {module info everything} {
set info [r info everything] set info [r info everything]
# info everything contains all default sections, but not ones for crash report # info everything contains all default sections, but not ones for crash report
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment