Skip to content

afr: fix possble memory leaks in rename - #4732

Open
zhangxyue wants to merge 1 commit into
gluster:develfrom
zhangxyue:devel
Open

afr: fix possble memory leaks in rename#4732
zhangxyue wants to merge 1 commit into
gluster:develfrom
zhangxyue:devel

Conversation

@zhangxyue

Copy link
Copy Markdown
Contributor

when one brick goes down, memory leaks after rename.

rename after one brick offline:
afr_changelog_do
AFR_ENTRY_RENAME_TRANSACTION
AFR_ENTRY_TRANSACTION

afr_changelog_cbk(..., cookie = i, xattr = dict1)
changelog_xdata[i] = dict_ref(dict1); // dict1 ref=2
afr_changelog_cbk(..., cookie = i, xattr = dict2) // second
changelog_xdata[i] = dict_ref(dict2); // without unref dict1

when one brick goes down, memory leaks after rename.

rename after one brick offline:
afr_changelog_do
    AFR_ENTRY_RENAME_TRANSACTION
    AFR_ENTRY_TRANSACTION

afr_changelog_cbk(..., cookie = i, xattr = dict1)
    changelog_xdata[i] = dict_ref(dict1);           // dict1 ref=2
afr_changelog_cbk(..., cookie = i, xattr = dict2)   // second
    changelog_xdata[i] = dict_ref(dict2);           // without unref dict1

Signed-off-by: 张越10286527 <zhang.yue5@zte.com.cn>
@ThalesBarretto

Copy link
Copy Markdown
Contributor

do you have a statedump or a reproducer?

@zhangxyue

Copy link
Copy Markdown
Contributor Author

do you have a statedump or a reproducer?

1、create 3*1 replicate volume, and start volume
2、shutdown one brick of them,and then do rename via fuse-daemon
3、statedump fuse-daemon, you can find dict_t、data_pair_t、data_t active-count is growing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants