<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glusterfs.git/xlators/cluster/ec/src/ec-inode-write.c, branch v3.6.1</title>
<subtitle></subtitle>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/'/>
<entry>
<title>ec: Fix self-heal issues</title>
<updated>2014-10-22T08:05:19+00:00</updated>
<author>
<name>Xavier Hernandez</name>
<email>xhernandez@datalab.es</email>
</author>
<published>2014-10-08T07:20:11+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=4522acc20bdd1ca17c053969ef7edce1bb6ede76'/>
<id>4522acc20bdd1ca17c053969ef7edce1bb6ede76</id>
<content type='text'>
Problem: Doing an 'ls' of a directory that has been modified while one
         of the bricks was down, sometimes returns the old directory
         contents.

Cause: Directories are not marked when they are modified as files are.
       The ec xlator balances requests amongst available and healthy
       bricks. Since there is no way to detect that a directory is
       out of date in one of the bricks, it is used from time to time
       to return the directory contents.

Solution: Basically the solution consists in use versioning information
          also for directories, however some additional changes have
          been necessary.

Changes:

 * Use directory versioning:

     This required to lock full directory instead of a single entry for
     all requests that add or remove entries from it. This is needed to
     allow atomic version update. This affects the following fops:

         create, mkdir, mknod, link, symlink, rename, unlink, rmdir

     Another side effect is that opendir requires to do a previous
     lookup to get versioning information and discard out of date
     bricks for subsequent readdir(p) calls.

 * Restrict directory self-heal:

     Till now, when one discrepancy was found in lookup, a self-heal
     was automatically started. This caused the versioning information
     of a bad directory to be healed instantly, making the original
     problem to reapear again.

     To solve this, when a missing directory is detected in one or more
     bricks on lookup or opendir fops, only a partial self-heal is
     performed on it. A partial self-heal basically creates the
     directory but does not restore any additional information.

     This avoids that an 'ls' could repair the directory and cause the
     problem to happen again. With this change, output of 'ls' is
     always consistent. However, since the directory has been created
     in the brick, this allows any other operation on it (create new
     files, for example) to succeed on all bricks and not add additional
     work to the self-heal process.

     To force a self-heal of a directory, any other operation must be
     done on it. For example a getxattr.

     With these changes, the correct healing procedure that would avoid
     inconsistent directory browsing consists on a post-order traversal
     of directoriesi being healed. This way, the directory contents will
     be healed before healing the directory itslef.

 * Additional changes to fix self-heal errors

     - Don't use fop-&gt;fd to decide between fd/loc.

         open, opendir and create have an fd, but the correct data is in
         loc.

     - Fix incorrect management of bad bricks per inode/fd.

     - Fix incorrect selection of fop's target bricks when there are bad
       bricks involved.

     - Improved ec_loc_parent() to always return a parent loc as
       complete as possible.

This is a backport of http://review.gluster.org/8916/

Change-Id: Iaf3df174d7857da57d4a87b4a8740a7048b366ad
BUG: 1149727
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8946
Reviewed-by: Dan Lambright &lt;dlambrig@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Doing an 'ls' of a directory that has been modified while one
         of the bricks was down, sometimes returns the old directory
         contents.

Cause: Directories are not marked when they are modified as files are.
       The ec xlator balances requests amongst available and healthy
       bricks. Since there is no way to detect that a directory is
       out of date in one of the bricks, it is used from time to time
       to return the directory contents.

Solution: Basically the solution consists in use versioning information
          also for directories, however some additional changes have
          been necessary.

Changes:

 * Use directory versioning:

     This required to lock full directory instead of a single entry for
     all requests that add or remove entries from it. This is needed to
     allow atomic version update. This affects the following fops:

         create, mkdir, mknod, link, symlink, rename, unlink, rmdir

     Another side effect is that opendir requires to do a previous
     lookup to get versioning information and discard out of date
     bricks for subsequent readdir(p) calls.

 * Restrict directory self-heal:

     Till now, when one discrepancy was found in lookup, a self-heal
     was automatically started. This caused the versioning information
     of a bad directory to be healed instantly, making the original
     problem to reapear again.

     To solve this, when a missing directory is detected in one or more
     bricks on lookup or opendir fops, only a partial self-heal is
     performed on it. A partial self-heal basically creates the
     directory but does not restore any additional information.

     This avoids that an 'ls' could repair the directory and cause the
     problem to happen again. With this change, output of 'ls' is
     always consistent. However, since the directory has been created
     in the brick, this allows any other operation on it (create new
     files, for example) to succeed on all bricks and not add additional
     work to the self-heal process.

     To force a self-heal of a directory, any other operation must be
     done on it. For example a getxattr.

     With these changes, the correct healing procedure that would avoid
     inconsistent directory browsing consists on a post-order traversal
     of directoriesi being healed. This way, the directory contents will
     be healed before healing the directory itslef.

 * Additional changes to fix self-heal errors

     - Don't use fop-&gt;fd to decide between fd/loc.

         open, opendir and create have an fd, but the correct data is in
         loc.

     - Fix incorrect management of bad bricks per inode/fd.

     - Fix incorrect selection of fop's target bricks when there are bad
       bricks involved.

     - Improved ec_loc_parent() to always return a parent loc as
       complete as possible.

This is a backport of http://review.gluster.org/8916/

Change-Id: Iaf3df174d7857da57d4a87b4a8740a7048b366ad
BUG: 1149727
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8946
Reviewed-by: Dan Lambright &lt;dlambrig@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ec: Fix invalid inode lock in ftruncate</title>
<updated>2014-09-19T19:31:46+00:00</updated>
<author>
<name>Xavier Hernandez</name>
<email>xhernandez@datalab.es</email>
</author>
<published>2014-09-10T21:43:07+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=b8c820be5f1d3ad7f60a2a0c7256081491d79d51'/>
<id>b8c820be5f1d3ad7f60a2a0c7256081491d79d51</id>
<content type='text'>
The fops 'truncate' and 'ftruncate' share some code and inodelk()
was always made against the inode inside the loc_t structure
instead of that of fd_t. Since ftruncate has the loc initialized
to NULL, this fop was executed without any lock, allowing some
concurrent modifications in the file size.

Also changed the way in which 'fop' and 'ffop' are differentiated
in shared code. Now it uses 'id' field instead of checking if 'fd'
is NULL.

This is a backport of http://review.gluster.org/8695/

Change-Id: Ibd18accf2652193b395a841b9029729e5f4867c6
BUG: 1140847
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8780
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Dan Lambright &lt;dlambrig@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fops 'truncate' and 'ftruncate' share some code and inodelk()
was always made against the inode inside the loc_t structure
instead of that of fd_t. Since ftruncate has the loc initialized
to NULL, this fop was executed without any lock, allowing some
concurrent modifications in the file size.

Also changed the way in which 'fop' and 'ffop' are differentiated
in shared code. Now it uses 'id' field instead of checking if 'fd'
is NULL.

This is a backport of http://review.gluster.org/8695/

Change-Id: Ibd18accf2652193b395a841b9029729e5f4867c6
BUG: 1140847
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8780
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Dan Lambright &lt;dlambrig@redhat.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ec: Optimize read/write performance</title>
<updated>2014-09-16T17:14:28+00:00</updated>
<author>
<name>Xavier Hernandez</name>
<email>xhernandez@datalab.es</email>
</author>
<published>2014-07-14T15:34:04+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=b224dd14b75fb993eec4f44ecf11edce8a6fc42f'/>
<id>b224dd14b75fb993eec4f44ecf11edce8a6fc42f</id>
<content type='text'>
This patch significantly improves performance of read/write
operations on a dispersed volume by reusing previous inodelk/
entrylk operations on the same inode/entry. This reduces the
latency of each individual operation considerably.

Inode version and size are also updated when needed instead
of on each request. This gives an additional boost.

This is a backport of http://review.gluster.org/8369/

Change-Id: I4b98d5508c86b53032e16e295f72a3f83fd8fcac
BUG: 1140844
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8746
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-by: Dan Lambright &lt;dlambrig@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch significantly improves performance of read/write
operations on a dispersed volume by reusing previous inodelk/
entrylk operations on the same inode/entry. This reduces the
latency of each individual operation considerably.

Inode version and size are also updated when needed instead
of on each request. This gives an additional boost.

This is a backport of http://review.gluster.org/8369/

Change-Id: I4b98d5508c86b53032e16e295f72a3f83fd8fcac
BUG: 1140844
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8746
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Reviewed-by: Dan Lambright &lt;dlambrig@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cluster/ec: Fix incorrect management of NFS requests</title>
<updated>2014-08-11T11:34:13+00:00</updated>
<author>
<name>Xavier Hernandez</name>
<email>xhernandez@datalab.es</email>
</author>
<published>2014-07-08T15:52:57+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=8935623e316b0e4448be4badd860b03a3763ea12'/>
<id>8935623e316b0e4448be4badd860b03a3763ea12</id>
<content type='text'>
Some operations, specially those comming from NFS, do not use a
regular fd and use an anonymous fd (i.e. a previous open call has
not been sent). Any context information created during open or
create will not be present on these fd's, so we simply return NULL
for contexts of those fd.

Also it seems that NFS can send write requests with a very big
buffer (higher that the default value of 128 KB). Some changes
have been made to correctly handle these large buffers.

This is a backport of http://review.gluster.org/8367.

Change-Id: I281476bd0d2cbaad231822248d6a616fcf5d4003
BUG: 1126734
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8367
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
Reviewed-on: http://review.gluster.org/8416
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some operations, specially those comming from NFS, do not use a
regular fd and use an anonymous fd (i.e. a previous open call has
not been sent). Any context information created during open or
create will not be present on these fd's, so we simply return NULL
for contexts of those fd.

Also it seems that NFS can send write requests with a very big
buffer (higher that the default value of 128 KB). Some changes
have been made to correctly handle these large buffers.

This is a backport of http://review.gluster.org/8367.

Change-Id: I281476bd0d2cbaad231822248d6a616fcf5d4003
BUG: 1126734
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8367
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
Reviewed-on: http://review.gluster.org/8416
</pre>
</div>
</content>
</entry>
<entry>
<title>ec: Fixed coverity scan issues</title>
<updated>2014-08-03T14:53:23+00:00</updated>
<author>
<name>Xavier Hernandez</name>
<email>xhernandez@datalab.es</email>
</author>
<published>2014-07-16T11:50:53+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=b0f2326bbf2127792a4dc090785948d55c53b6e5'/>
<id>b0f2326bbf2127792a4dc090785948d55c53b6e5</id>
<content type='text'>
CID list:

  1226163 Logically dead code
  1226166 Missing break in switch
  1226167 Missing break in switch
  1226168 Missing break in switch
  1226169 Missing break in switch
  1226170 Missing break in switch
  1226171 Missing break in switch
  1226172 Missing break in switch
  1226173 Missing break in switch
  1226174 Missing break in switch
  1226175 Missing break in switch
  1226176 Missing break in switch
  1226177 Missing break in switch
  1226178 Data race condition
  1226179 Data race condition
  1226180 Data race condition
  1226181 Thread deadlock
  1226182 Uninitialized pointer read
  1226183 Uninitialized pointer read
  1226184 Read from pointer after free

Change-Id: I4d33aa42289371927175c43bb29e018df64fb943
BUG: 1122834
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8372
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CID list:

  1226163 Logically dead code
  1226166 Missing break in switch
  1226167 Missing break in switch
  1226168 Missing break in switch
  1226169 Missing break in switch
  1226170 Missing break in switch
  1226171 Missing break in switch
  1226172 Missing break in switch
  1226173 Missing break in switch
  1226174 Missing break in switch
  1226175 Missing break in switch
  1226176 Missing break in switch
  1226177 Missing break in switch
  1226178 Data race condition
  1226179 Data race condition
  1226180 Data race condition
  1226181 Thread deadlock
  1226182 Uninitialized pointer read
  1226183 Uninitialized pointer read
  1226184 Read from pointer after free

Change-Id: I4d33aa42289371927175c43bb29e018df64fb943
BUG: 1122834
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/8372
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cluster/ec: Added erasure code translator</title>
<updated>2014-07-11T17:33:40+00:00</updated>
<author>
<name>Xavier Hernandez</name>
<email>xhernandez@datalab.es</email>
</author>
<published>2014-05-05T10:57:34+00:00</published>
<link rel='alternate' type='text/html' href='http://dev.gluster.org/cgit/glusterfs.git/commit/?id=ad112305a1c7452b13c92238b40ded80361838f3'/>
<id>ad112305a1c7452b13c92238b40ded80361838f3</id>
<content type='text'>
Change-Id: I293917501d5c2ca4cdc6303df30cf0b568cea361
BUG: 1118629
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/7749
Reviewed-by: Krishnan Parthasarathi &lt;kparthas@redhat.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I293917501d5c2ca4cdc6303df30cf0b568cea361
BUG: 1118629
Signed-off-by: Xavier Hernandez &lt;xhernandez@datalab.es&gt;
Reviewed-on: http://review.gluster.org/7749
Reviewed-by: Krishnan Parthasarathi &lt;kparthas@redhat.com&gt;
Reviewed-by: Jeff Darcy &lt;jdarcy@redhat.com&gt;
Tested-by: Gluster Build System &lt;jenkins@build.gluster.com&gt;
Reviewed-by: Vijay Bellur &lt;vbellur@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
