diff options
| author | Mohit Agrawal <moagrawal@redhat.com> | 2019-04-15 10:34:34 +0530 | 
|---|---|---|
| committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2019-04-16 10:59:36 +0000 | 
| commit | d2de3f66393d4f737e21eedab4200563a60f8bcc (patch) | |
| tree | 6139b66b4ceee3b2e391a405bd2f878c12deed55 /glusterfsd/src/glusterfsd.c | |
| parent | 80d2dae631369d2e4b5e5f4aa0a102b541c22ad5 (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
> (Cherry picked from commit 798aadbe51a9a02dd98a0f861cc239ecf7c8ed57)
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22495/)
Change-Id: If91682830f894ab8f6857f19dcb1797fc15ca64c
Fixes: bz#1699715
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 17 | 
1 files changed, 15 insertions, 2 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 5d46b3d9f45..fc86cbdccc9 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -275,6 +275,7 @@ static struct argp_option gf_options[] = {       "attribute, dentry and page-cache. "       "Disable this only if same files/directories are not accessed across "       "two different mounts concurrently [default: \"on\"]"}, +    {"brick-mux", ARGP_BRICK_MUX_KEY, 0, 0, "Enable brick mux. "},      {0, 0, 0, 0, "Miscellaneous Options:"},      {          0, @@ -711,7 +712,6 @@ create_fuse_mount(glusterfs_ctx_t *ctx)      xlator_t *master = NULL;      cmd_args = &ctx->cmd_args; -      if (!cmd_args->mount_point) {          gf_msg_trace("glusterfsd", 0,                       "mount point not found, not a client process"); @@ -1099,6 +1099,10 @@ parse_opts(int key, char *arg, struct argp_state *state)              cmd_args->thin_client = _gf_true;              break; +        case ARGP_BRICK_MUX_KEY: +            cmd_args->brick_mux = _gf_true; +            break; +          case ARGP_PID_FILE_KEY:              cmd_args->pid_file = gf_strdup(arg);              break; @@ -1216,7 +1220,6 @@ parse_opts(int key, char *arg, struct argp_state *state)          case ARGP_KEY_ARG:              if (state->arg_num >= 1)                  argp_usage(state); -              cmd_args->mount_point = gf_strdup(arg);              break; @@ -2549,6 +2552,8 @@ postfork:          if (ret)              goto out;      } +    gf_log("glusterfs", GF_LOG_INFO, "Pid of current running process is %d", +           getpid());      ret = gf_log_inject_timer_event(ctx);      glusterfs_signals_setup(ctx); @@ -2814,6 +2819,14 @@ main(int argc, char *argv[])      if (ret)          goto out; +    /* set brick_mux mode only for server process */ +    if ((ctx->process_mode != GF_SERVER_PROCESS) && cmd->brick_mux) { +        gf_msg("glusterfs", GF_LOG_CRITICAL, 0, glusterfsd_msg_40, +               "command line argument --brick-mux is valid only for brick " +               "process"); +        goto out; +    } +      /* log the version of glusterfs running here along with the actual         command line options. */      {  | 
