<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/features/changelog/src, branch master</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>features/changelog: simplify and cleanup internal time management</title>
<updated>2020-08-22T03:48:19+00:00</updated>
<author>
<name>Dmitry Antipov</name>
<email>dmantipov@yandex.ru</email>
</author>
<published>2020-08-06T12:19:50+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=eb0943cef9cbc65d2e9f85ba7aca3dfeb86d3429'/>
<id>eb0943cef9cbc65d2e9f85ba7aca3dfeb86d3429</id>
<content type='text'>
Drop extra point of failure in changelog_fill_rollover_data(),
changelog_init() and reconfigure(), consistently use time_t
and gf_time() where appropriate, adjust all related users.

Change-Id: Id8e4236e96789cd74da5fdc3da05f0c1df98a62b
Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Updates: #1002
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Drop extra point of failure in changelog_fill_rollover_data(),
changelog_init() and reconfigure(), consistently use time_t
and gf_time() where appropriate, adjust all related users.

Change-Id: Id8e4236e96789cd74da5fdc3da05f0c1df98a62b
Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Updates: #1002
</pre>
</div>
</content>
</entry>
<entry>
<title>libglusterfs: add library wrapper for time()</title>
<updated>2020-08-17T11:27:09+00:00</updated>
<author>
<name>Dmitry Antipov</name>
<email>dmantipov@yandex.ru</email>
</author>
<published>2020-08-10T08:45:58+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=9978ceb26327de9545c6e0a4f9230b401e629793'/>
<id>9978ceb26327de9545c6e0a4f9230b401e629793</id>
<content type='text'>
Add thin convenient library wrapper gf_time(),
adjust related users and comments as well.

Change-Id: If8969af2f45ee69c30c3406bce5baa8305fb7f80
Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Updates: #1002
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add thin convenient library wrapper gf_time(),
adjust related users and comments as well.

Change-Id: If8969af2f45ee69c30c3406bce5baa8305fb7f80
Signed-off-by: Dmitry Antipov &lt;dmantipov@yandex.ru&gt;
Updates: #1002
</pre>
</div>
</content>
</entry>
<entry>
<title>afr/changelog: fix NULL dereferences and error handling</title>
<updated>2020-05-26T03:03:18+00:00</updated>
<author>
<name>Ashish Pandey</name>
<email>aspandey@redhat.com</email>
</author>
<published>2020-04-28T06:01:17+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=61c4695ea1411feeea7a802c37446bc0df45e31c'/>
<id>61c4695ea1411feeea7a802c37446bc0df45e31c</id>
<content type='text'>
This patch includes the following CID from Coverity Scan:
 *1419116
 *1420206

Change-Id: Id92fd6a78c8a00726a61aa4697b5c126ced8ed4d
Updates: #1202
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch includes the following CID from Coverity Scan:
 *1419116
 *1420206

Change-Id: Id92fd6a78c8a00726a61aa4697b5c126ced8ed4d
Updates: #1202
</pre>
</div>
</content>
</entry>
<entry>
<title>core[brick_mux]: brick crashed when creating and deleting volumes over time</title>
<updated>2020-03-27T15:19:20+00:00</updated>
<author>
<name>Mohit Agrawal</name>
<email>moagrawal@redhat.com</email>
</author>
<published>2020-03-04T03:47:26+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=e589d8de66d3325da8fbbbe44d1a5bd6335e08ab'/>
<id>e589d8de66d3325da8fbbbe44d1a5bd6335e08ab</id>
<content type='text'>
Problem: In brick_mux environment, while volumes are created/stopped in a loop
         after running a long time the main brick is crashed.The brick is crashed
         because the main brick process was not cleaned up memory for all objects
         at the time of detaching a volume.
         Below are the objects that are missed at the time of detaching a volume
         1) xlator object for a brick graph
         2) local_pool for posix_lock xlator
         3) rpc object cleanup at quota xlator
         4) inode leak at brick xlator

Solution: To avoid the crash resolve all leak at the time of detaching a brick
Change-Id: Ibb6e46c5fba22b9441a88cbaf6b3278823235913
updates: #977
Signed-off-by: Mohit Agrawal &lt;moagrawa@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: In brick_mux environment, while volumes are created/stopped in a loop
         after running a long time the main brick is crashed.The brick is crashed
         because the main brick process was not cleaned up memory for all objects
         at the time of detaching a volume.
         Below are the objects that are missed at the time of detaching a volume
         1) xlator object for a brick graph
         2) local_pool for posix_lock xlator
         3) rpc object cleanup at quota xlator
         4) inode leak at brick xlator

Solution: To avoid the crash resolve all leak at the time of detaching a brick
Change-Id: Ibb6e46c5fba22b9441a88cbaf6b3278823235913
updates: #977
Signed-off-by: Mohit Agrawal &lt;moagrawa@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>feature/changelog: Avoid thread creation if xlator is not enabled</title>
<updated>2020-02-09T12:42:56+00:00</updated>
<author>
<name>Mohit Agrawal</name>
<email>moagrawal@redhat.com</email>
</author>
<published>2018-09-29T07:45:35+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=6de80bcd6366778ac34ce58ec496fa08cc02bd0b'/>
<id>6de80bcd6366778ac34ce58ec496fa08cc02bd0b</id>
<content type='text'>
Problem:
Changelog creates threads even if the changelog is not enabled

Background:
Changelog xlator broadly does two things
  1. Journalling - Cosumers are geo-rep and glusterfind
  2. Event Notification for registered events like (open, release etc) -
     Consumers are bitrot, geo-rep

The existing option "changelog.changelog" controls journalling and
there is no option to control event notification and is enabled by
default. So when bitrot/geo-rep is not enabled on the volume, threads
and resources(rpc and rbuf) related to event notifications consumes
resources and cpu cycle which is unnecessary.

Solution:
The solution is to have two different options as below.
 1. changelog-notification : Event notifications
 2. changelog : Journalling

This patch introduces the option "changelog-notification" which is
not exposed to user. When either bitrot or changelog (journalling)
is enabled, it internally enbales 'changelog-notification'. But
once the 'changelog-notification' is enabled, it will not be disabled
for the life time of the brick process even after bitrot and changelog
is disabled. As of now, rpc resource cleanup has lot of races and is
difficult to cleanup cleanly. If allowed, it leads to memory leaks
and crashes on enable/disable of bitrot or changelog (journal) in a
loop. Hence to be safer, the event notification is not disabled within
lifetime of process once enabled.

Change-Id: Ifd00286e0966049e8eb9f21567fe407cf11bb02a
Updates: #475
Signed-off-by: Mohit Agrawal &lt;moagrawal@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
Changelog creates threads even if the changelog is not enabled

Background:
Changelog xlator broadly does two things
  1. Journalling - Cosumers are geo-rep and glusterfind
  2. Event Notification for registered events like (open, release etc) -
     Consumers are bitrot, geo-rep

The existing option "changelog.changelog" controls journalling and
there is no option to control event notification and is enabled by
default. So when bitrot/geo-rep is not enabled on the volume, threads
and resources(rpc and rbuf) related to event notifications consumes
resources and cpu cycle which is unnecessary.

Solution:
The solution is to have two different options as below.
 1. changelog-notification : Event notifications
 2. changelog : Journalling

This patch introduces the option "changelog-notification" which is
not exposed to user. When either bitrot or changelog (journalling)
is enabled, it internally enbales 'changelog-notification'. But
once the 'changelog-notification' is enabled, it will not be disabled
for the life time of the brick process even after bitrot and changelog
is disabled. As of now, rpc resource cleanup has lot of races and is
difficult to cleanup cleanly. If allowed, it leads to memory leaks
and crashes on enable/disable of bitrot or changelog (journal) in a
loop. Hence to be safer, the event notification is not disabled within
lifetime of process once enabled.

Change-Id: Ifd00286e0966049e8eb9f21567fe407cf11bb02a
Updates: #475
Signed-off-by: Mohit Agrawal &lt;moagrawal@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xlator/changelog: structure logging</title>
<updated>2020-01-14T17:06:38+00:00</updated>
<author>
<name>yatipadia</name>
<email>ypadia@redhat.com</email>
</author>
<published>2019-12-04T06:39:12+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=dc5b2d3c181020da1644106e5b17f77a4f3e53df'/>
<id>dc5b2d3c181020da1644106e5b17f77a4f3e53df</id>
<content type='text'>
convert all gf_msg() to gf_smsg()

Change-Id: I2303aeaa0775b663e2ea5741166a457cd747d2ac
Updates: #657
Signed-off-by: yatipadia &lt;ypadia@redhat.com&gt;
Signed-off-by: yatip &lt;ypadia@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
convert all gf_msg() to gf_smsg()

Change-Id: I2303aeaa0775b663e2ea5741166a457cd747d2ac
Updates: #657
Signed-off-by: yatipadia &lt;ypadia@redhat.com&gt;
Signed-off-by: yatip &lt;ypadia@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>features/changelog: Optimization in changelog</title>
<updated>2020-01-01T07:11:23+00:00</updated>
<author>
<name>Shwetha K Acharya</name>
<email>sacharya@redhat.com</email>
</author>
<published>2019-11-14T07:07:24+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ec3df84dcfd7ccda0a18fa75e3b425c090209adf'/>
<id>ec3df84dcfd7ccda0a18fa75e3b425c090209adf</id>
<content type='text'>
Problem: Currently changelog is written in one directory, which over
time, results in very large changelog files.

Solution: Seperate directory under the changelogs directory
is created on daily basis following the format year/month/day.

Updates: #154
Change-Id: I1cdabe33728a0ba1f298c8908bd8c323b1871bda
Signed-off-by: Shwetha K Acharya &lt;sacharya@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Currently changelog is written in one directory, which over
time, results in very large changelog files.

Solution: Seperate directory under the changelogs directory
is created on daily basis following the format year/month/day.

Updates: #154
Change-Id: I1cdabe33728a0ba1f298c8908bd8c323b1871bda
Signed-off-by: Shwetha K Acharya &lt;sacharya@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rpc: align structs</title>
<updated>2019-10-17T06:34:27+00:00</updated>
<author>
<name>Yaniv Kaul</name>
<email>ykaul@redhat.com</email>
</author>
<published>2019-09-13T18:27:44+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=f737a745b54c2dffe5e3e3203cea1eecf1c7ecf1'/>
<id>f737a745b54c2dffe5e3e3203cea1eecf1c7ecf1</id>
<content type='text'>
squash tens of warnings on padding of structs in afr structures.
The warnings were found by manually added '-Wpadded' to the GCC
command line.

Also made relevant structs and definitions static, where it
was applicable.

Change-Id: Ib71a7e9c6179378f072d796d11172d086c343e53
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
squash tens of warnings on padding of structs in afr structures.
The warnings were found by manually added '-Wpadded' to the GCC
command line.

Also made relevant structs and definitions static, where it
was applicable.

Change-Id: Ib71a7e9c6179378f072d796d11172d086c343e53
updates: bz#1193929
Signed-off-by: Yaniv Kaul &lt;ykaul@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>logging: Structured logging reference PR</title>
<updated>2019-08-20T09:32:44+00:00</updated>
<author>
<name>Aravinda VK</name>
<email>avishwan@redhat.com</email>
</author>
<published>2019-07-03T09:38:31+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=2fe243d0561c19009964003aa2ced7c695a46d17'/>
<id>2fe243d0561c19009964003aa2ced7c695a46d17</id>
<content type='text'>
To convert the existing `gf_msg` to `gf_smsg`:

- Define `_STR` of respective Message ID as below(In `*-messages.h`)

  #define PC_MSG_REMOTE_OP_FAILED_STR "remote operation failed."

- Change `gf_msg` to use `gf_smsg`. Convert values into fields and
  add any missing fields. Note: `errno` and `error` fields will be
  added automatically to log message in case errnum is specified.

  Example:

  gf_smsg(
    this-&gt;name,                            // Name or log domain
    GF_LOG_WARNING,                        // Log Level
    rsp.op_errno,                          // Error number
    PC_MSG_REMOTE_OP_FAILED,               // Message ID
    "path=%s", local-&gt;loc.path,            // Key Value 1
    "gfid=%s", loc_gfid_utoa(&amp;local-&gt;loc), // Key Value 2
    NULL                                   // Log End
  );

Key value pairs formatting Help:

  gf_slog(
    this-&gt;name,                               // Name or log domain
    GF_LOG_WARNING,                           // Log Level
    rsp.op_errno,                             // Error number
    PC_MSG_REMOTE_OP_FAILED,                  // Message ID
    "op=CREATE",                              // Static Key and Value
    "path=%s", local-&gt;loc.path,               // Format for Value
    "brick-%d-status=%s", brkidx, brkstatus,  // Use format for key and val
    NULL                                      // Log End
  );

Before:

[2019-07-03 08:16:18.226819] W [MSGID: 114031] [client-rpc-fops_v2.c \
:2633:client4_0_lookup_cbk] 0-gv3-client-0: remote operation failed. \
Path: / (00000000-0000-0000-0000-000000000001) [Transport endpoint   \
is not connected]

After:

[2019-07-29 07:50:15.773765] W [MSGID: 114031]                   \
[client-rpc-fops_v2.c:2633:client4_0_lookup_cbk] 0-gv1-client-0: \
remote operation failed. [{path=/f1},                            \
{gfid=00000000-0000-0000-0000-000000000000},                     \
{errno=107}, {error=Transport endpoint is not connected}]

To add new `gf_smsg`, Add a Message ID in respective `*-messages.h` file
and the follow the steps mentioned above.

Change-Id: I4e7d37f27f106ab398e991d931ba2ac7841a44b1
Updates: #657
Signed-off-by: Aravinda VK &lt;avishwan@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To convert the existing `gf_msg` to `gf_smsg`:

- Define `_STR` of respective Message ID as below(In `*-messages.h`)

  #define PC_MSG_REMOTE_OP_FAILED_STR "remote operation failed."

- Change `gf_msg` to use `gf_smsg`. Convert values into fields and
  add any missing fields. Note: `errno` and `error` fields will be
  added automatically to log message in case errnum is specified.

  Example:

  gf_smsg(
    this-&gt;name,                            // Name or log domain
    GF_LOG_WARNING,                        // Log Level
    rsp.op_errno,                          // Error number
    PC_MSG_REMOTE_OP_FAILED,               // Message ID
    "path=%s", local-&gt;loc.path,            // Key Value 1
    "gfid=%s", loc_gfid_utoa(&amp;local-&gt;loc), // Key Value 2
    NULL                                   // Log End
  );

Key value pairs formatting Help:

  gf_slog(
    this-&gt;name,                               // Name or log domain
    GF_LOG_WARNING,                           // Log Level
    rsp.op_errno,                             // Error number
    PC_MSG_REMOTE_OP_FAILED,                  // Message ID
    "op=CREATE",                              // Static Key and Value
    "path=%s", local-&gt;loc.path,               // Format for Value
    "brick-%d-status=%s", brkidx, brkstatus,  // Use format for key and val
    NULL                                      // Log End
  );

Before:

[2019-07-03 08:16:18.226819] W [MSGID: 114031] [client-rpc-fops_v2.c \
:2633:client4_0_lookup_cbk] 0-gv3-client-0: remote operation failed. \
Path: / (00000000-0000-0000-0000-000000000001) [Transport endpoint   \
is not connected]

After:

[2019-07-29 07:50:15.773765] W [MSGID: 114031]                   \
[client-rpc-fops_v2.c:2633:client4_0_lookup_cbk] 0-gv1-client-0: \
remote operation failed. [{path=/f1},                            \
{gfid=00000000-0000-0000-0000-000000000000},                     \
{errno=107}, {error=Transport endpoint is not connected}]

To add new `gf_smsg`, Add a Message ID in respective `*-messages.h` file
and the follow the steps mentioned above.

Change-Id: I4e7d37f27f106ab398e991d931ba2ac7841a44b1
Updates: #657
Signed-off-by: Aravinda VK &lt;avishwan@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>event: rename event_XXX with gf_ prefixed</title>
<updated>2019-07-29T04:43:56+00:00</updated>
<author>
<name>Xiubo Li</name>
<email>xiubli@redhat.com</email>
</author>
<published>2019-07-26T04:34:52+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=799edc73c3d4f694c365c6a7c27c9ab8eed5f260'/>
<id>799edc73c3d4f694c365c6a7c27c9ab8eed5f260</id>
<content type='text'>
I hit one crash issue when using the libgfapi.

In the libgfapi it will call glfs_poller() --&gt; event_dispatch()
in file api/src/glfs.c:721, and the event_dispatch() is defined
by libgluster locally, the problem is the name of event_dispatch()
is the extremly the same with the one from libevent package form
the OS.

For example, if a executable program Foo, which will also use and
link the libevent and the libgfapi at the same time, I can hit the
crash, like:

kernel: glfs_glfspoll[68486]: segfault at 1c0 ip 00007fef006fd2b8 sp
00007feeeaffce30 error 4 in libevent-2.0.so.5.1.9[7fef006ed000+46000]

The link for Foo is:
lib_foo_LADD = -levent $(GFAPI_LIBS)
It will crash.

This is because the glfs_poller() is calling the event_dispatch() from
the libevent, not the libglsuter.

The gfapi link info :
GFAPI_LIBS = -lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid

If I link Foo like:
lib_foo_LADD = $(GFAPI_LIBS) -levent
It will works well without any problem.

And if Foo call one private lib, such as handler_glfs.so, and the
handler_glfs.so will link the GFAPI_LIBS directly, while the Foo won't
and it will dlopen(handler_glfs.so), then the crash will be hit everytime.

The link info will be:
foo_LADD = -levent
libhandler_glfs_LIBADD = $(GFAPI_LIBS)

I can avoid the crash temporarily by linking the GFAPI_LIBS in Foo too like:
foo_LADD = $(GFAPI_LIBS) -levent
libhandler_glfs_LIBADD = $(GFAPI_LIBS)

But this is ugly since the Foo won't use any APIs from the GFAPI_LIBS.

And in some cases when the --as-needed link option is added(on many dists
it is added as default), then the crash is back again, the above workaround
won't work.

Fixes: #699

Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa
Signed-off-by: Xiubo Li &lt;xiubli@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I hit one crash issue when using the libgfapi.

In the libgfapi it will call glfs_poller() --&gt; event_dispatch()
in file api/src/glfs.c:721, and the event_dispatch() is defined
by libgluster locally, the problem is the name of event_dispatch()
is the extremly the same with the one from libevent package form
the OS.

For example, if a executable program Foo, which will also use and
link the libevent and the libgfapi at the same time, I can hit the
crash, like:

kernel: glfs_glfspoll[68486]: segfault at 1c0 ip 00007fef006fd2b8 sp
00007feeeaffce30 error 4 in libevent-2.0.so.5.1.9[7fef006ed000+46000]

The link for Foo is:
lib_foo_LADD = -levent $(GFAPI_LIBS)
It will crash.

This is because the glfs_poller() is calling the event_dispatch() from
the libevent, not the libglsuter.

The gfapi link info :
GFAPI_LIBS = -lacl -lgfapi -lglusterfs -lgfrpc -lgfxdr -luuid

If I link Foo like:
lib_foo_LADD = $(GFAPI_LIBS) -levent
It will works well without any problem.

And if Foo call one private lib, such as handler_glfs.so, and the
handler_glfs.so will link the GFAPI_LIBS directly, while the Foo won't
and it will dlopen(handler_glfs.so), then the crash will be hit everytime.

The link info will be:
foo_LADD = -levent
libhandler_glfs_LIBADD = $(GFAPI_LIBS)

I can avoid the crash temporarily by linking the GFAPI_LIBS in Foo too like:
foo_LADD = $(GFAPI_LIBS) -levent
libhandler_glfs_LIBADD = $(GFAPI_LIBS)

But this is ugly since the Foo won't use any APIs from the GFAPI_LIBS.

And in some cases when the --as-needed link option is added(on many dists
it is added as default), then the crash is back again, the above workaround
won't work.

Fixes: #699

Change-Id: I38f0200b941bd1cff4bf3066fca2fc1f9a5263aa
Signed-off-by: Xiubo Li &lt;xiubli@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
