summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authorShay Fadida <shayfadida@gmail.com>2022-09-21 08:10:03 +0300
committerGitHub <noreply@github.com>2022-09-21 08:10:03 +0300
commiteedb8b172474dd7776d9bbb0f2954a1394027289 (patch)
tree7edb11c9a8ebdd3eb8e76839567586b7f012319d /src/server.c
parentc2b0c13d5c0fab49131f6f5e844f80bfa43f6219 (diff)
downloadredis-eedb8b172474dd7776d9bbb0f2954a1394027289.tar.gz
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: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server.c b/src/server.c
index 797c79fc3..a1f8eca78 100644
--- a/src/server.c
+++ b/src/server.c
@@ -6010,9 +6010,13 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
}
/* Get info from modules.
- * if user asked for "everything" or "modules", or a specific section
- * that's not found yet. */
- if (everything || dictFind(section_dict, "modules") != NULL || sections < (int)dictSize(section_dict)) {
+ * Returned when the user asked for "everything", "modules", or a specific module section.
+ * We're not aware of the module section names here, and we rather avoid the search when we can.
+ * 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,
everything || dictFind(section_dict, "modules") != NULL ? NULL: section_dict,