diff options
author | Mohit Agrawal <moagrawal@redhat.com> | 2019-04-04 09:56:11 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-04-15 04:30:43 +0000 |
commit | 798aadbe51a9a02dd98a0f861cc239ecf7c8ed57 (patch) | |
tree | 492c9d756bdacfbeb7db8f0ce975d33c99e01097 /xlators | |
parent | a67929e18a39d5c79a4a7e2b78015523626a367e (diff) |
core: Log level changes do not effect on running client process
Problem: commit c34e4161f3cb6539ec83a9020f3d27eb4759a975 set log-level
per xlator during reconfigure only for a brick process not for
the client process.
Solution: 1) Change per xlator log-level only if brick_mux is enabled.To make sure
about brick multiplex introudce a flag brick_mux at ctx->cmd_args.
Note: There are two other changes done with this patch
1) Ignore client-log-level option to attach a brick with
already running brick if brick_mux is enabled
2) Add a log to print pid of the running process to make easier
debugging
Change-Id: I39e85de778e150d0685cd9a79425ce8b4783f9c9
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Fixes: bz#1696046
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 22 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 7 |
2 files changed, 20 insertions, 9 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 101e403d39a..b9422c0f335 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -3705,19 +3705,23 @@ xlator_set_loglevel(xlator_t *this, int log_level) active = ctx->active; top = active->first; - if (strcmp(top->type, "protocol/server") || (log_level == -1)) + if (log_level == -1) return; - /* Set log-level for server xlator */ - top->loglevel = log_level; + if (ctx->cmd_args.brick_mux) { + /* Set log-level for all brick xlators */ + top->loglevel = log_level; - /* Set log-level for parent xlator */ - if (this->parents) - this->parents->xlator->loglevel = log_level; + /* Set log-level for parent xlator */ + if (this->parents) + this->parents->xlator->loglevel = log_level; - while (trav) { - trav->loglevel = log_level; - trav = trav->next; + while (trav) { + trav->loglevel = log_level; + trav = trav->next; + } + } else { + gf_log_set_loglevel(this->ctx, log_level); } } diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 87914c4799c..50534852d8d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2161,6 +2161,9 @@ retry: if (volinfo->memory_accounting) runner_add_arg(&runner, "--mem-accounting"); + if (is_brick_mx_enabled()) + runner_add_arg(&runner, "--brick-mux"); + runner_log(&runner, "", 0, "Starting GlusterFS"); brickinfo->port = port; @@ -2299,6 +2302,10 @@ unsafe_option(dict_t *this, char *key, data_t *value, void *arg) return _gf_false; } + if (fnmatch("*diagnostics.client-log*", key, 0) == 0) { + return _gf_false; + } + return _gf_true; } |