Bug 1703629 - statedump is not capturing info related to glusterd
Summary: statedump is not capturing info related to glusterd
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: glusterd
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sanju
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1703759
TreeView+ depends on / blocked
 
Reported: 2019-04-27 01:59 UTC by Sanju
Modified: 2019-04-29 14:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1703759 (view as bug list)
Environment:
Last Closed: 2019-04-28 07:07:30 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gluster.org Gerrit 22640 0 None Merged glusterd: define dumpops in the xlator_api of glusterd 2019-04-28 07:07:29 UTC

Description Sanju 2019-04-27 01:59:54 UTC
Description of problem:
statedump is not capturing the glusterd's mem dump.

Version-Release number of selected component (if applicable):
mainline

How reproducible:
always

Steps to Reproduce:
1. Take a statdump of glusterd
kill -USR1 `pidof glusterd`
2. check for glusterd related information
3.

Actual results:
glusterd related information is missing

Expected results:
statedump should capture info related to glusterd

Additional info:

Comment 1 Sanju 2019-04-27 02:14:03 UTC
RCA:

(gdb) b gf_proc_dump_single_xlator_info
Breakpoint 1 at 0x7f19954b7e20: file statedump.c, line 480.
(gdb) c
Continuing.
[Switching to Thread 0x7f198bb2f700 (LWP 10078)]

Thread 3 "glfs_sigwait" hit Breakpoint 1, gf_proc_dump_single_xlator_info (trav=trav@entry=0x133ae30)
    at statedump.c:480
480	{
(gdb) n
482	    char itable_key[1024] = {
(gdb) 
480	{
(gdb) 
482	    char itable_key[1024] = {
(gdb) 
480	{
(gdb) 
481	    glusterfs_ctx_t *ctx = trav->ctx;
(gdb) 
482	    char itable_key[1024] = {
(gdb) 
486	    if (trav->cleanup_starting)
(gdb) 
489	    if (ctx->measure_latency)
(gdb) 
490	        gf_proc_dump_latency_info(trav);
(gdb) 
492	    gf_proc_dump_xlator_mem_info(trav);
(gdb) 
494	    if (GF_PROC_DUMP_IS_XL_OPTION_ENABLED(inode) && (trav->itable)) {
(gdb) 
499	    if (!trav->dumpops) {
(gdb) l
494	    if (GF_PROC_DUMP_IS_XL_OPTION_ENABLED(inode) && (trav->itable)) {
495	        snprintf(itable_key, sizeof(itable_key), "%d.%s.itable", ctx->graph_id,
496	                 trav->name);
497	    }
498	
499	    if (!trav->dumpops) {
500	        return;
501	    }
502	
503	    if (trav->dumpops->priv && GF_PROC_DUMP_IS_XL_OPTION_ENABLED(priv))
(gdb) p trav->dumpops
$3 = (struct xlator_dumpops *) 0x0
(gdb) c
Continuing.

In gf_proc_dump_single_xlator_info() trav->dumpops is null and function is returned to caller at line #500.

If we look at xlator_api in glusterd.c file, we missed giving .dumpops value here. That's why trav->dumpops is null.
xlator_api_t xlator_api = {
    .init = init,
    .fini = fini,
    .mem_acct_init = mem_acct_init,
    .op_version = {1}, /* Present from the initial version */
    .fops = &fops,
    .cbks = &cbks,
    .options = options,
    .identifier = "glusterd",
    .category = GF_MAINTAINED,
};

We have defined dumpops as below. we should add this information in xlator api.
struct xlator_dumpops dumpops = {
    .priv = glusterd_dump_priv,
};

xlator_api_t xlator_api = {
    .init = init,
    .fini = fini,
    .mem_acct_init = mem_acct_init,
    .op_version = {1}, /* Present from the initial version */
    .dumpops = &dumpops,  //added here, now trav->dumpops won't be null for glusterd
    .fops = &fops,
    .cbks = &cbks,
    .options = options,
    .identifier = "glusterd",
    .category = GF_MAINTAINED,
};

Thanks,
Sanju

Comment 2 Worker Ant 2019-04-27 02:19:19 UTC
REVIEW: https://review.gluster.org/22640 (glusterd: add glusterd information in statedump) posted (#1) for review on master by Sanju Rakonde

Comment 3 Worker Ant 2019-04-28 07:07:30 UTC
REVIEW: https://review.gluster.org/22640 (glusterd: define dumpops in the xlator_api of glusterd) merged (#2) on master by Sanju Rakonde


Note You need to log in before you can comment on or make changes to this bug.