[sheepdog] [PATCH stable-0.8 2/3] sheep/request: straightforward error message in sheep_exec_req

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Jul 29 03:32:01 CEST 2014


From: Ruoyu <liangry at ucweb.com>

Current message as below in sheep_exec_req is rather confused.

ERROR [rw 6471] sheep_exec_req(1133) failed No object found

In fact, I don't know which node sends the request and what it
wants to do. They are the minimum requirements for any investigation.

I think this is very helpful to diagnose an issue.

ERROR [rw 16160] sheep_exec_req(1135) failed No object found,
remote address: 127.0.0.1:7002, op name: GET_HASH

Signed-off-by: Ruoyu <liangry at ucweb.com>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/request.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sheep/request.c b/sheep/request.c
index 4aa928e..8fc378a 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -1093,7 +1093,10 @@ worker_fn int sheep_exec_req(const struct node_id *nid, struct sd_req *hdr,
 	}
 	ret = rsp->result;
 	if (ret != SD_RES_SUCCESS)
-		sd_err("failed %s", sd_strerror(ret));
+		sd_err("failed %s, remote address: %s, op name: %s",
+				sd_strerror(ret),
+				addr_to_str(nid->addr, nid->port),
+				op_name(get_sd_op(hdr->opcode)));
 
 	sockfd_cache_put(nid, sfd);
 	return ret;
-- 
1.9.1




More information about the sheepdog mailing list