diff options
| author | Amar Tumballi <amar@gluster.com> | 2011-04-12 10:30:24 +0000 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-04-13 00:38:47 -0700 | 
| commit | ba365f725a91bcd3dcfae1d8311f9f148ce69055 (patch) | |
| tree | 9179bd2f6bbb0f0d0ce3ba54a7cfe7edaa70c46f | |
| parent | d7cba3b0bb4867e02a5999f830e5315cd7022520 (diff) | |
remove excessive logs due to log enhancement
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2346 (Log message enhancements in GlusterFS - phase 1)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
| -rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 20 | ||||
| -rw-r--r-- | xlators/performance/io-cache/src/page.c | 3 | ||||
| -rw-r--r-- | xlators/performance/stat-prefetch/src/stat-prefetch.c | 3 | ||||
| -rw-r--r-- | xlators/protocol/client/src/client-handshake.c | 12 | ||||
| -rw-r--r-- | xlators/protocol/client/src/client.c | 9 | ||||
| -rw-r--r-- | xlators/protocol/client/src/client.h | 2 | ||||
| -rw-r--r-- | xlators/protocol/server/src/server3_1-fops.c | 10 | 
7 files changed, 38 insertions, 21 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 62f22e20f1c..a8d329f2242 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -279,11 +279,15 @@ __socket_disconnect (rpc_transport_t *this)          priv = this->private;          if (priv->sock != -1) { -                ret = shutdown (priv->sock, SHUT_RDWR);                  priv->connected = -1; -                gf_log (this->name, GF_LOG_INFO, -                        "shutdown() returned %d. set connection state to -1", -                        ret); +                ret = shutdown (priv->sock, SHUT_RDWR); +                if (ret) { +                        /* its already disconnected.. no need to understand +                           why it failed to shutdown in normal cases */ +                        gf_log (this->name, GF_LOG_DEBUG, +                                "shutdown() returned %d. %s", +                                ret, strerror (errno)); +                }          }  out: @@ -1482,9 +1486,11 @@ __socket_proto_state_machine (rpc_transport_t *this,                                                &priv->incoming.pending_count,                                                NULL);                          if (ret == -1) { -                                gf_log (this->name, GF_LOG_WARNING, -                                        "reading from socket failed. Error (%s), " -                                        "peer (%s)", strerror (errno), +                                gf_log (this->name, +                                        ((priv->connected == 1) ? +                                         GF_LOG_WARNING : GF_LOG_DEBUG), +                                        "reading from socket failed. Error (%s)" +                                        ", peer (%s)", strerror (errno),                                          this->peerinfo.identifier);                                  goto out;                          } diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index b50b245ac0b..0721f5f04a3 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -85,7 +85,8 @@ ioc_page_destroy (ioc_page_t *page)          GF_VALIDATE_OR_GOTO ("io-cache", page, out); -        page_size = iobref_size (page->iobref); +        if (page->iobref) +                page_size = iobref_size (page->iobref);          if (page->waitq) {                  /* frames waiting on this page, do not destroy this page */ diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 7717e3d727c..b99c91bce64 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -894,7 +894,8 @@ sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  goto out;          } -        if (op_ret == -1) { +        /* For '/' Entry is never cached, don't try to remove it */ +        if ((op_ret == -1) && local->loc.parent) {                  sp_remove_caches_from_all_fds_opened (this, local->loc.parent,                                                        (char *)local->loc.name);          } diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 1ba128b9496..5af149d568a 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -536,7 +536,7 @@ client3_1_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count,                          local->loc.path, rsp.fd);          } -	if (-1 == rsp.op_ret) { +        if (-1 == rsp.op_ret) {                  ret = -1;                  goto out;          } @@ -1156,11 +1156,15 @@ client_query_portmap_cbk (struct rpc_req *req, struct iovec *iov, int count, voi          if (-1 == rsp.op_ret) {                  ret = -1; -                gf_log (this->name, GF_LOG_ERROR, +                gf_log (this->name, ((!conf->portmap_err_logged) ? +                                     GF_LOG_ERROR : GF_LOG_DEBUG),                          "failed to get the port number for remote subvolume"); +                conf->portmap_err_logged = 1;                  goto out;          } +        conf->portmap_err_logged = 0; +          config.remote_port = rsp.port;          rpc_clnt_reconfig (conf->rpc, &config);          conf->skip_notify = 1; @@ -1170,9 +1174,9 @@ out:                  STACK_DESTROY (frame->root);          if (conf) { - +                /* Need this to connect the same transport on different port */ +                /* ie, glusterd to glusterfsd */                  rpc_transport_disconnect (conf->rpc->conn.trans); -                  rpc_clnt_reconnect (conf->rpc->conn.trans);          } diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index e58f95db05e..ff766844d84 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -69,11 +69,14 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame,          if (!(conf->connected ||                ((prog->prognum == GLUSTER_DUMP_PROGRAM) ||                 (prog->prognum == GLUSTER_PMAP_PROGRAM) || -               ((prog->prognum == GLUSTER_HNDSK_PROGRAM) && (procnum == GF_HNDSK_SETVOLUME))))) { -                gf_log (this->name, GF_LOG_WARNING, +               ((prog->prognum == GLUSTER_HNDSK_PROGRAM) && +                (procnum == GF_HNDSK_SETVOLUME))))) { +                /* This particular error captured/logged in +                   functions calling this */ +                gf_log (this->name, GF_LOG_DEBUG,                          "connection in disconnected state");                  goto out; -        } +       }          iobuf = iobuf_get (this->ctx->iobuf_pool);          if (!iobuf) { diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index 21451b37e2d..40a3d5d3d37 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -64,6 +64,8 @@ typedef struct clnt_conf {          int                    last_sent_event; /* Flag used to make sure we are                                                     not repeating the same event                                                     which was sent earlier */ +        char                   portmap_err_logged; /* flag used to prevent +                                                      excessive logging */  } clnt_conf_t;  typedef struct _client_fd_ctx { diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index d234b8abf01..eb51640d9a4 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -211,7 +211,7 @@ server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  }                  gf_proto_flock_from_flock (&rsp.flock, lock); -        } else if (op_errno != ENOSYS) { +        } else if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {                  gf_log (this->name, GF_LOG_INFO,                          "%"PRId64": LK %"PRId64" (%"PRId64") ==> %"PRId32" (%s)",                          frame->root->unique, state->resolve.fd_no, @@ -251,7 +251,7 @@ server_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                          gf_add_locker (conn->ltable, state->volume,                                         &state->loc, NULL, frame->root->pid,                                         frame->root->lk_owner, GF_FOP_INODELK); -        } else if (op_errno != ENOSYS) { +        } else if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {                  gf_log (this->name, GF_LOG_INFO,                          "%"PRId64": INODELK %s (%"PRId64") ==> %"PRId32" (%s)",                          frame->root->unique, state->loc.path, @@ -293,7 +293,7 @@ server_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                                         NULL, state->fd,                                         frame->root->pid,                                         frame->root->lk_owner, GF_FOP_INODELK); -        } else if (op_errno != ENOSYS) { +        } else if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {                  gf_log (this->name, GF_LOG_INFO,                          "%"PRId64": FINODELK %"PRId64" (%"PRId64") ==> %"PRId32" (%s)",                          frame->root->unique, state->resolve.fd_no, @@ -332,7 +332,7 @@ server_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                          gf_add_locker (conn->ltable, state->volume,                                         &state->loc, NULL, frame->root->pid,                                         frame->root->lk_owner, GF_FOP_ENTRYLK); -        } else if (op_errno != ENOSYS) { +        } else if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {                  gf_log (this->name, GF_LOG_INFO,                          "%"PRId64": INODELK %s (%"PRId64") ==> %"PRId32" (%s)",                          frame->root->unique, state->loc.path, @@ -370,7 +370,7 @@ server_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                          gf_add_locker (conn->ltable, state->volume,                                         NULL, state->fd, frame->root->pid,                                         frame->root->lk_owner, GF_FOP_ENTRYLK); -        } else if (op_errno != ENOSYS) { +        } else if ((op_errno != ENOSYS) && (op_errno != EAGAIN)) {                  gf_log (this->name, GF_LOG_INFO,                          "%"PRId64": FENTRYLK %"PRId64" (%"PRId64") "                          " ==> %"PRId32" (%s)",  | 
