<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
How about storing the same data variable(from new_xl options dict)
with a ref in the options dictionary of old xlator.<br>
<br>
Regards<br>
Rafi KC<br>
<br>
<div class="moz-cite-prefix">On 07/14/2016 08:28 AM, Pranith Kumar
Karampuri wrote:<br>
</div>
<blockquote
cite="mid:CAOgeEnaTHi0xQDtaU26UBmznKwGOm_2MQXuYD7C=ZzoPvxBfVQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>hi,<br>
</div>
I wanted to remove 'get_new_dict()', 'dict_destroy()'
usage through out the code base to prevent people from using it
wrong. Regression for that patch <a moz-do-not-send="true"
href="http://review.gluster.org/13183">http://review.gluster.org/13183</a>
kept failing and I found that the 'xl->options' dictionary is
created using get_new_dict() i.e. it doesn't have any refs. And
in xlator_members_free() we try to destroy it using dict_unref()
i.e. ref count becomes '-1' and the dictionary doesn't get
destroyed. so every reconfigure is leaking dictionaries. So all
the options which use string options actually point to the
values in these dictionaries. Initially I thought we can have
latest reconfigured options dictionary also stored in new member
'xl->reconfigured_options' but the problem is reconfigure can
partially succeed leading to dilemma about which options
succeeded/failed and which dictionary to keep around. Failing in
reconfigure doesn't stop the brick. At the moment the only way
out I see is to perform [de]allocation of the string, bool(we
can prevent for bool) options, may be there are more, I need to
check. But this becomes one more big patch('fini' should GF_FREE
all these options), so wondering if anyone has any other
thoughts on fixing this properly without a lot of code changes.<br
clear="all">
<div>
<div><br>
-- <br>
<div class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">Pranith<br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Gluster-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a>
<a class="moz-txt-link-freetext" href="http://www.gluster.org/mailman/listinfo/gluster-devel">http://www.gluster.org/mailman/listinfo/gluster-devel</a></pre>
</blockquote>
<br>
</body>
</html>