|
|
887953 |
From 56fb13d05cb4465c14cc231bab1296a48c33c57d Mon Sep 17 00:00:00 2001
|
|
|
887953 |
From: Mohit Agrawal <moagrawa@redhat.com>
|
|
|
887953 |
Date: Tue, 6 Nov 2018 09:06:34 +0530
|
|
|
887953 |
Subject: [PATCH 419/444] glusterfs: During reconfigure set log-level per
|
|
|
887953 |
xlator level
|
|
|
887953 |
|
|
|
887953 |
Problem: In brick_mux environment, while a user has enabled brick-log-level
|
|
|
887953 |
for anyone volume, it automatically enables for other volumes
|
|
|
887953 |
also those are attached with same brick.
|
|
|
887953 |
|
|
|
887953 |
Solution: A log-level option is automatically enabled for other volumes
|
|
|
887953 |
because log-level saved in glusterfsd_ctx and ctx is common for
|
|
|
887953 |
volumes those are attached with same brick. To resolve it
|
|
|
887953 |
set log level for all children xlator's at the time of the graph
|
|
|
887953 |
reconfigure at io-stat xlator.
|
|
|
887953 |
|
|
|
887953 |
> Change-Id: Id9a6efa05d286e0bea2d47f49292d084e7bb2fcf
|
|
|
887953 |
> fixes: bz#1640495
|
|
|
887953 |
> (Reviwed on upstream link https://review.gluster.org/#/c/glusterfs/+/20488/)
|
|
|
887953 |
> (Cherry pick from commit c34e4161f3cb6539ec83a9020f3d27eb4759a975)
|
|
|
887953 |
|
|
|
887953 |
Change-Id: I1dd57c52997f16e8a05f982c6c05bb4f758e8bd3
|
|
|
887953 |
BUG: 1598407
|
|
|
887953 |
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
|
|
887953 |
Reviewed-on: https://code.engineering.redhat.com/gerrit/155021
|
|
|
887953 |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
887953 |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
887953 |
---
|
|
|
887953 |
xlators/debug/io-stats/src/io-stats.c | 32 +++++++++++++++++++++++++++++++-
|
|
|
887953 |
1 file changed, 31 insertions(+), 1 deletion(-)
|
|
|
887953 |
|
|
|
887953 |
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
|
|
|
887953 |
index 0f71334..aade097 100644
|
|
|
887953 |
--- a/xlators/debug/io-stats/src/io-stats.c
|
|
|
887953 |
+++ b/xlators/debug/io-stats/src/io-stats.c
|
|
|
887953 |
@@ -3812,6 +3812,35 @@ ios_set_log_format_code (struct ios_conf *conf)
|
|
|
887953 |
conf->dump_format = IOS_DUMP_TYPE_SAMPLES;
|
|
|
887953 |
}
|
|
|
887953 |
|
|
|
887953 |
+void
|
|
|
887953 |
+xlator_set_loglevel(xlator_t *this, int log_level)
|
|
|
887953 |
+{
|
|
|
887953 |
+ glusterfs_ctx_t *ctx = NULL;
|
|
|
887953 |
+ glusterfs_graph_t *active = NULL;
|
|
|
887953 |
+ xlator_t *top = NULL;
|
|
|
887953 |
+ xlator_t *trav = this;
|
|
|
887953 |
+
|
|
|
887953 |
+ ctx = this->ctx;
|
|
|
887953 |
+ GF_ASSERT(ctx);
|
|
|
887953 |
+ active = ctx->active;
|
|
|
887953 |
+ top = active->first;
|
|
|
887953 |
+
|
|
|
887953 |
+ if (strcmp(top->type, "protocol/server") || (log_level == -1))
|
|
|
887953 |
+ return;
|
|
|
887953 |
+
|
|
|
887953 |
+ /* Set log-level for server xlator */
|
|
|
887953 |
+ top->loglevel = log_level;
|
|
|
887953 |
+
|
|
|
887953 |
+ /* Set log-level for parent xlator */
|
|
|
887953 |
+ if (this->parents)
|
|
|
887953 |
+ this->parents->xlator->loglevel = log_level;
|
|
|
887953 |
+
|
|
|
887953 |
+ while (trav) {
|
|
|
887953 |
+ trav->loglevel = log_level;
|
|
|
887953 |
+ trav = trav->next;
|
|
|
887953 |
+ }
|
|
|
887953 |
+}
|
|
|
887953 |
+
|
|
|
887953 |
int
|
|
|
887953 |
reconfigure (xlator_t *this, dict_t *options)
|
|
|
887953 |
{
|
|
|
887953 |
@@ -3867,7 +3896,8 @@ reconfigure (xlator_t *this, dict_t *options)
|
|
|
887953 |
GF_OPTION_RECONF ("log-level", log_str, options, str, out);
|
|
|
887953 |
if (log_str) {
|
|
|
887953 |
log_level = glusterd_check_log_level (log_str);
|
|
|
887953 |
- gf_log_set_loglevel (log_level);
|
|
|
887953 |
+ /* Set loglevel for all children and server xlators */
|
|
|
887953 |
+ xlator_set_loglevel(this, log_level);
|
|
|
887953 |
}
|
|
|
887953 |
|
|
|
887953 |
GF_OPTION_RECONF ("logger", logger_str, options, str, out);
|
|
|
887953 |
--
|
|
|
887953 |
1.8.3.1
|
|
|
887953 |
|