summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src/shard.h
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-04-06 18:10:41 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-04-10 11:45:51 -0400
commitd71ec72b981d110199c3376f39f91b704241975c (patch)
tree37392e186acfc99a7a4ef9b8153574fd60c16433 /xlators/features/shard/src/shard.h
parentd5d599abaa598062885abc7ad8226faf26d11e64 (diff)
features/shard: Fix vm corruption upon fix-layout
Backport of: https://review.gluster.org/17010 shard's writev implementation, as part of identifying presence of participant shards that aren't in memory, first sends an MKNOD on these shards, and upon EEXIST error, looks up the shards before proceeding with the writes. The VM corruption was caused when the following happened: 1. DHT had n subvolumes initially. 2. Upon add-brick + fix-layout, the layout of .shard changed although the existing shards under it were yet to be migrated to their new hashed subvolumes. 3. During this time, there were writes on the VM falling in regions of the file whose corresponding shards were already existing under .shard. 4. Sharding xl sent MKNOD on these shards, now creating them in their new hashed subvolumes although there already exist shard blocks for this region with valid data. 5. All subsequent writes were wound on these newly created copies. The net outcome is that both copies of the shard didn't have the correct data. This caused the affected VMs to be unbootable. FIX: For want of better alternatives in DHT, the fix changes shard fops to do a LOOKUP before the MKNOD and upon EEXIST error, perform another lookup. Change-Id: I1a5d3515b42e2e5583c407d1b4aff44d7ce472eb BUG: 1440635 RCA'd-by: Raghavendra Gowdappa <rgowdapp@redhat.com> Reported-by: Mahdi Adnan <mahdi.adnan@outlook.com> Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: https://review.gluster.org/17019 CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'xlators/features/shard/src/shard.h')
-rw-r--r--xlators/features/shard/src/shard.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h
index 09232a45f24..73195983aa4 100644
--- a/xlators/features/shard/src/shard.h
+++ b/xlators/features/shard/src/shard.h
@@ -255,6 +255,7 @@ typedef struct shard_local {
shard_lock_t *shard_lock;
} lock;
inode_t *resolver_base_inode;
+ gf_boolean_t first_lookup_done;
} shard_local_t;
typedef struct shard_inode_ctx {