<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/mgmt, branch master</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>cluster/afr: Heal directory rename without rmdir/mkdir</title>
<updated>2020-10-01T12:03:25+00:00</updated>
<author>
<name>Pranith Kumar K</name>
<email>pkarampu@redhat.com</email>
</author>
<published>2020-04-13T14:01:51+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=9ecbd69127d373ac000e9e1be00c1829e49e64a4'/>
<id>9ecbd69127d373ac000e9e1be00c1829e49e64a4</id>
<content type='text'>
Problem1:
When a directory is renamed while a brick
is down entry-heal always did an rm -rf on that directory on
the sink on old location and did mkdir and created the directory
hierarchy again in the new location. This is inefficient.

Problem2:
Renamedir heal order may lead to a scenario where directory in
the new location could be created before deleting it from old
location leading to 2 directories with same gfid in posix.

Fix:
As part of heal, if oldlocation is healed first and is not present in
source-brick always rename it into a hidden directory inside the
sink-brick so that when heal is triggered in new-location shd can
rename it from this hidden directory to the new-location.

If new-location heal is triggered first and it detects that the
directory already exists in the brick, then it should skip healing the
directory until it appears in the hidden directory.

Credits: Ravi for rename-data-loss.t script

Fixes: #1211
Change-Id: I0cba2006f35cd03d314d18211ce0bd530e254843
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem1:
When a directory is renamed while a brick
is down entry-heal always did an rm -rf on that directory on
the sink on old location and did mkdir and created the directory
hierarchy again in the new location. This is inefficient.

Problem2:
Renamedir heal order may lead to a scenario where directory in
the new location could be created before deleting it from old
location leading to 2 directories with same gfid in posix.

Fix:
As part of heal, if oldlocation is healed first and is not present in
source-brick always rename it into a hidden directory inside the
sink-brick so that when heal is triggered in new-location shd can
rename it from this hidden directory to the new-location.

If new-location heal is triggered first and it detects that the
directory already exists in the brick, then it should skip healing the
directory until it appears in the hidden directory.

Credits: Ravi for rename-data-loss.t script

Fixes: #1211
Change-Id: I0cba2006f35cd03d314d18211ce0bd530e254843
Signed-off-by: Pranith Kumar K &lt;pkarampu@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: start the brick on a different port</title>
<updated>2020-09-29T13:15:21+00:00</updated>
<author>
<name>Sanju Rakonde</name>
<email>srakonde@redhat.com</email>
</author>
<published>2020-08-26T14:35:35+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=a0effc34aff418d6ecd4760c77587f5da25ca8cf'/>
<id>a0effc34aff418d6ecd4760c77587f5da25ca8cf</id>
<content type='text'>
Problem: brick fails to start when the port provided by
glusterd is in use by any other process

Solution: glusterd should check errno set by runner_run()
and if it is set to EADDRINUSE, it should allocate a new
port to the brick and try to start it again.

Previously ret value is checked instead of errno, so the
retry part never executed. Now, we initialize errno to 0
before calling runner framework. and afterwards store the
errno into ret to avoid modification of errno in subsequent
function calls.

fixes: #1101

Change-Id: I1aa048a77c5f8b035dece36976d60602d9753b1a
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
Signed-off-by: nik-redhat &lt;nladha@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: brick fails to start when the port provided by
glusterd is in use by any other process

Solution: glusterd should check errno set by runner_run()
and if it is set to EADDRINUSE, it should allocate a new
port to the brick and try to start it again.

Previously ret value is checked instead of errno, so the
retry part never executed. Now, we initialize errno to 0
before calling runner framework. and afterwards store the
errno into ret to avoid modification of errno in subsequent
function calls.

fixes: #1101

Change-Id: I1aa048a77c5f8b035dece36976d60602d9753b1a
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
Signed-off-by: nik-redhat &lt;nladha@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: Replacing str with ptr in strchr to reduce comparison</title>
<updated>2020-09-28T06:09:36+00:00</updated>
<author>
<name>srijan-sivakumar</name>
<email>ssivakum@redhat.com</email>
</author>
<published>2020-09-26T13:47:41+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=2d2ea54a2cd895aef40e39109ea98c94aa02a473'/>
<id>2d2ea54a2cd895aef40e39109ea98c94aa02a473</id>
<content type='text'>
Issue: On seeing the function glusterd_replace_slash_with_hyphen
we see that the strchr inside the while loop takes str as a
parameter, that'd mean repeated comparison from index 0 of str
even though the characters have already been compared. Why not
use ptr instead which points to the latest replacement in the
string.

Code change: replacing str with ptr inside the strchr function.

Fixes: #1516
Change-Id: Id049ec2ad9800a01730f2a0263d9e0528557ae81
Signed-off-by: srijan-sivakumar &lt;ssivakum@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue: On seeing the function glusterd_replace_slash_with_hyphen
we see that the strchr inside the while loop takes str as a
parameter, that'd mean repeated comparison from index 0 of str
even though the characters have already been compared. Why not
use ptr instead which points to the latest replacement in the
string.

Code change: replacing str with ptr inside the strchr function.

Fixes: #1516
Change-Id: Id049ec2ad9800a01730f2a0263d9e0528557ae81
Signed-off-by: srijan-sivakumar &lt;ssivakum@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: resource leaks</title>
<updated>2020-09-25T12:29:22+00:00</updated>
<author>
<name>nik-redhat</name>
<email>nladha@redhat.com</email>
</author>
<published>2020-09-25T12:26:19+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=99df784c1c6a086904cf3b77585a1797b1cc7b8e'/>
<id>99df784c1c6a086904cf3b77585a1797b1cc7b8e</id>
<content type='text'>
Issue:
iobref was not freed before exiting the function.

Fix:
Modified the code to free iobref before exiting.

CID: 1430107
Updates: #1060

Change-Id: I89351b3aa645792eb8dda6292d1e559057b02d8b
Signed-off-by: nik-redhat &lt;nladha@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue:
iobref was not freed before exiting the function.

Fix:
Modified the code to free iobref before exiting.

CID: 1430107
Updates: #1060

Change-Id: I89351b3aa645792eb8dda6292d1e559057b02d8b
Signed-off-by: nik-redhat &lt;nladha@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: Fix Add-brick with increasing replica count failure</title>
<updated>2020-09-24T12:49:15+00:00</updated>
<author>
<name>Sheetal Pamecha</name>
<email>spamecha@redhat.com</email>
</author>
<published>2020-09-23T12:11:46+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=3b8ee834a3b58780721e37767a274e7c9730eba0'/>
<id>3b8ee834a3b58780721e37767a274e7c9730eba0</id>
<content type='text'>
Problem: add-brick operation fails with multiple bricks on same
server error when replica count is increased.

This was happening because of extra runs in a loop to compare
hostnames and if bricks supplied were less than "replica" count,
the bricks will get compared to itself resulting in above error.

Fixes: #1508
Change-Id: I8668e964340b7bf59728bb838525d2db062197ed
Signed-off-by: Sheetal Pamecha &lt;spamecha@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: add-brick operation fails with multiple bricks on same
server error when replica count is increased.

This was happening because of extra runs in a loop to compare
hostnames and if bricks supplied were less than "replica" count,
the bricks will get compared to itself resulting in above error.

Fixes: #1508
Change-Id: I8668e964340b7bf59728bb838525d2db062197ed
Signed-off-by: Sheetal Pamecha &lt;spamecha@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: Removing strlen and using existing len field of data_t</title>
<updated>2020-09-24T03:32:54+00:00</updated>
<author>
<name>srijan-sivakumar</name>
<email>ssivakum@redhat.com</email>
</author>
<published>2020-09-21T13:44:01+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ecb8d666753cc536105538b178a9eaf8874dafdf'/>
<id>ecb8d666753cc536105538b178a9eaf8874dafdf</id>
<content type='text'>
Issue: The strlen being used to find the length of the dictionary is
an extra step as there already exists len field in data_t which contains
the same value.

Code Change :
1. Replacing the strlen with len.
2. Removing a typecast which wasn't required.

Fixes: #1497
Change-Id: I2780c3876b17b8825038d222fb489a87e090411f
Signed-off-by: srijan-sivakumar &lt;ssivakum@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue: The strlen being used to find the length of the dictionary is
an extra step as there already exists len field in data_t which contains
the same value.

Code Change :
1. Replacing the strlen with len.
2. Removing a typecast which wasn't required.

Fixes: #1497
Change-Id: I2780c3876b17b8825038d222fb489a87e090411f
Signed-off-by: srijan-sivakumar &lt;ssivakum@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: Fixing coverity issues.</title>
<updated>2020-09-24T03:31:03+00:00</updated>
<author>
<name>srijan-sivakumar</name>
<email>ssivakum@redhat.com</email>
</author>
<published>2020-09-21T14:01:08+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=5a1644c892adeb370fdd6eb2adf0d49e0cf553b4'/>
<id>5a1644c892adeb370fdd6eb2adf0d49e0cf553b4</id>
<content type='text'>
Fixing Incorrect expression (IDENTICAL_BRANCHES) reported by
the coverity scan.

CID: 1432721

Change-Id: If6ab3a129dffb6c5fcc618e775f99bc1125003ab
Updates: #1060
Signed-off-by: srijan-sivakumar &lt;ssivakum@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixing Incorrect expression (IDENTICAL_BRANCHES) reported by
the coverity scan.

CID: 1432721

Change-Id: If6ab3a129dffb6c5fcc618e775f99bc1125003ab
Updates: #1060
Signed-off-by: srijan-sivakumar &lt;ssivakum@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: add post-commit phase to the transaction</title>
<updated>2020-09-21T03:58:30+00:00</updated>
<author>
<name>Sanju Rakonde</name>
<email>srakonde@redhat.com</email>
</author>
<published>2020-07-24T08:41:24+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=f86b1d4459580c74e516daa6542aa076bbcf131d'/>
<id>f86b1d4459580c74e516daa6542aa076bbcf131d</id>
<content type='text'>
This is part 2 of the fix. part 1 is at
https://review.gluster.org/#/c/glusterfs/+/24325/

This patch adds post commit phase to the mgmt v3 transaction
framework.

In post commit phase we replace the old auth.allow list
in case of add-brick and replace-brick.

fixes: #1391

Change-Id: I41c871d59e6252d27163b042ad710e929d7d0399
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is part 2 of the fix. part 1 is at
https://review.gluster.org/#/c/glusterfs/+/24325/

This patch adds post commit phase to the mgmt v3 transaction
framework.

In post commit phase we replace the old auth.allow list
in case of add-brick and replace-brick.

fixes: #1391

Change-Id: I41c871d59e6252d27163b042ad710e929d7d0399
Signed-off-by: Sanju Rakonde &lt;srakonde@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd: mount directory getting truncated on mounting shared_storage</title>
<updated>2020-09-20T14:06:23+00:00</updated>
<author>
<name>nik-redhat</name>
<email>nladha@redhat.com</email>
</author>
<published>2020-09-15T10:50:19+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=0ec6d61567ab1b5e481de45bdeb9912ffe5e89d7'/>
<id>0ec6d61567ab1b5e481de45bdeb9912ffe5e89d7</id>
<content type='text'>
Issue:
In case of a user created volume the mount point
is the brick path 'ex: /data/brick' but in case of
shared_storage the mount point is '/'.So, here
we increment the array by one so as to get the exact
path of brick without '/', which works fine for other
volumes as the pointer of the brick_dir variable is
at '/', but for shared_storage it is at 'v'(where v is
starting letter of 'var' directory). So, on incrementing
the path we get in case of shared_storage starts from
'ar/lib/glusterd/...'

Fix:
Only, increment the pointer if the current position is '/',
else the path will be wrong.

Fixes: #1480

Change-Id: Id31bb13f58134ae2099884fbc5984c4e055fb357
Signed-off-by: nik-redhat &lt;nladha@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue:
In case of a user created volume the mount point
is the brick path 'ex: /data/brick' but in case of
shared_storage the mount point is '/'.So, here
we increment the array by one so as to get the exact
path of brick without '/', which works fine for other
volumes as the pointer of the brick_dir variable is
at '/', but for shared_storage it is at 'v'(where v is
starting letter of 'var' directory). So, on incrementing
the path we get in case of shared_storage starts from
'ar/lib/glusterd/...'

Fix:
Only, increment the pointer if the current position is '/',
else the path will be wrong.

Fixes: #1480

Change-Id: Id31bb13f58134ae2099884fbc5984c4e055fb357
Signed-off-by: nik-redhat &lt;nladha@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>glusterd:Reducing file operations when writing options into volfile.</title>
<updated>2020-09-17T12:10:58+00:00</updated>
<author>
<name>Srijan Sivakumar</name>
<email>ssivakum@redhat.com</email>
</author>
<published>2020-06-02T11:17:24+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=558fe62a28f05fab2a913e9e9ed1206ed2d28d71'/>
<id>558fe62a28f05fab2a913e9e9ed1206ed2d28d71</id>
<content type='text'>
Issue: The options to be written into the volfile are in form of
key-value pairs and the current approach taken to write them into
a file is to invoke the write syscall for each key-value pair.
This implies an increased number of system calls.

Code Changes:
1. Addition of a structure, glusterd_volinfo_data_store_t in
glusterd-store.h, containing a character buffer, a pointer to
gf_store_handle_t, the current length of data in the buffer as
well as a flag for checking key while storing in the buffer.
This is used for passing the required file descriptor as well
having a character buffer for storing multiple options before
being written into a file.

2. Modification of function, _storeopts in glusterd-store.c, which
now invokes the gf_store_save_items when buffer is to be emptied
into the volfile before further write into it. Also, it has
replaced the function _storeslaves, _gd_store_rebalance_dict
and _store_global_opts.

3. Modification of function, glusterd_store_volinfo_write in
glusterd-store.c, wherein a pointer of type
glusterd_volinfo_data_store_t is initialized for further
operation. Also, the buffer is emptied into the volfile before
it is freed.

4. Modification of function, glusterd_store_node_state_write in
glusterd-store.c, wherein the a pointer of type
glusterd_volinfo_data_store_t is initialized for further operations.
Also, the buffer is emptied into the volfile before it is freed.

5. Addition of enum into glusterd-mem-types.h

6. Modification of function, glusterd_store_options in
glusterd-store.c, wherein a pointer of type
glusterd_volinfo_data_store_t is initialized for further opertaions.
Also, the buffer is emptied into the volfile before it is freed.

Reasoning behind the approach:
1.Instead of a dynamic allocation of buffer or increasing the buffer
size with increased number of options, it, the current approach takes
a buffer of fixed size (VOLINFO_BUFFER_SIZE). Before any write into
the buffer, the size is checked and if it exceeds the available space,
the contents of the buffer are written to the file before copying new
contents. Dynamic allocation can lead to increased memory usage as one
doesn't know the number of options that could be added in time and may
go on to occupy more space than mandated.

2.The function dict_foreach is a generic function used across different
modules. It made sense not to change its implementation as it might
affect other Functionalities. Hence a structure was added which could
just be passed as one of the parameter to this function (as it takes
a void*).

3. Reduced number of system calls implies an increase in execution speed.
Also, these modified functions come into play whenever the volume is
started or modified.

4. The functions _storeslaves, _gd_store_rebalace_dict and
_store_global_opts were doing the same set of operations as that of
_storeopts except the checking for the key. This has been handled
with the help of a flag in the glusterd_volinfo_data_store_t structure.
This reduces the duplicate code present.

Signed-off-by: Srijan Sivakumar &lt;ssivakum@redhat.com&gt;
Change-Id: I22e6e91c78ed51e3a171482054d77bf793b9ab16
Fixes: #718
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue: The options to be written into the volfile are in form of
key-value pairs and the current approach taken to write them into
a file is to invoke the write syscall for each key-value pair.
This implies an increased number of system calls.

Code Changes:
1. Addition of a structure, glusterd_volinfo_data_store_t in
glusterd-store.h, containing a character buffer, a pointer to
gf_store_handle_t, the current length of data in the buffer as
well as a flag for checking key while storing in the buffer.
This is used for passing the required file descriptor as well
having a character buffer for storing multiple options before
being written into a file.

2. Modification of function, _storeopts in glusterd-store.c, which
now invokes the gf_store_save_items when buffer is to be emptied
into the volfile before further write into it. Also, it has
replaced the function _storeslaves, _gd_store_rebalance_dict
and _store_global_opts.

3. Modification of function, glusterd_store_volinfo_write in
glusterd-store.c, wherein a pointer of type
glusterd_volinfo_data_store_t is initialized for further
operation. Also, the buffer is emptied into the volfile before
it is freed.

4. Modification of function, glusterd_store_node_state_write in
glusterd-store.c, wherein the a pointer of type
glusterd_volinfo_data_store_t is initialized for further operations.
Also, the buffer is emptied into the volfile before it is freed.

5. Addition of enum into glusterd-mem-types.h

6. Modification of function, glusterd_store_options in
glusterd-store.c, wherein a pointer of type
glusterd_volinfo_data_store_t is initialized for further opertaions.
Also, the buffer is emptied into the volfile before it is freed.

Reasoning behind the approach:
1.Instead of a dynamic allocation of buffer or increasing the buffer
size with increased number of options, it, the current approach takes
a buffer of fixed size (VOLINFO_BUFFER_SIZE). Before any write into
the buffer, the size is checked and if it exceeds the available space,
the contents of the buffer are written to the file before copying new
contents. Dynamic allocation can lead to increased memory usage as one
doesn't know the number of options that could be added in time and may
go on to occupy more space than mandated.

2.The function dict_foreach is a generic function used across different
modules. It made sense not to change its implementation as it might
affect other Functionalities. Hence a structure was added which could
just be passed as one of the parameter to this function (as it takes
a void*).

3. Reduced number of system calls implies an increase in execution speed.
Also, these modified functions come into play whenever the volume is
started or modified.

4. The functions _storeslaves, _gd_store_rebalace_dict and
_store_global_opts were doing the same set of operations as that of
_storeopts except the checking for the key. This has been handled
with the help of a flag in the glusterd_volinfo_data_store_t structure.
This reduces the duplicate code present.

Signed-off-by: Srijan Sivakumar &lt;ssivakum@redhat.com&gt;
Change-Id: I22e6e91c78ed51e3a171482054d77bf793b9ab16
Fixes: #718
</pre>
</div>
</content>
</entry>
</feed>
