path: root/xlators/cluster/ec/src/ec-helpers.h
diff options
authorKrutika Dhananjay <>2016-07-28 21:29:59 +0530
committerPranith Kumar Karampuri <>2016-08-22 02:38:36 -0700
commitfcb5b70b1099d0379b40c81f35750df8bb9545a5 (patch)
tree51aad26970b01dac983f2db04c36587f17b9cb60 /xlators/cluster/ec/src/ec-helpers.h
parentfad93c16a3fc52171f3f2b024baa5bc8b8749bee (diff)
cluster/afr: Prevent split-brain when bricks are brought off and on in cyclic order
When the bricks are brought offline and then online in cyclic order while writes are in progress on a file, thanks to inode refresh in write txns, AFR will mostly fail the write attempt when the only good copy is offline. However, there is still a remote possibility that the file will run into split-brain if the brick that has the lone good copy goes offline *after* the inode refresh but *before* the write txn completes (I call it in-flight split-brain in the patch for ease of reference), requiring intervention from admin to resolve the split-brain before the IO can resume normally on the file. To get around this, the patch does the following things: i) retains the dirty xattrs on the file ii) avoids marking the last of the good copies as bad (or accused) in case it is the one to go down during the course of a write. iii) fails that particular write with the appropriate errno. This way, we still have one good copy left despite the split-brain situation which when it is back online, will be chosen as source to do the heal. Change-Id: I9ca634b026ac830b172bac076437cc3bf1ae7d8a BUG: 1363721 Signed-off-by: Krutika Dhananjay <> Reviewed-on: Tested-by: Pranith Kumar Karampuri <> Smoke: Gluster Build System <> CentOS-regression: Gluster Build System <> Reviewed-by: Ravishankar N <> Reviewed-by: Oleksandr Natalenko <> NetBSD-regression: NetBSD Build System <> Reviewed-by: Pranith Kumar Karampuri <>
Diffstat (limited to 'xlators/cluster/ec/src/ec-helpers.h')
1 files changed, 0 insertions, 2 deletions
diff --git a/xlators/cluster/ec/src/ec-helpers.h b/xlators/cluster/ec/src/ec-helpers.h
index 1f39da2c09f..93d77726089 100644
--- a/xlators/cluster/ec/src/ec-helpers.h
+++ b/xlators/cluster/ec/src/ec-helpers.h
@@ -16,8 +16,6 @@
const char * ec_bin(char * str, size_t size, uint64_t value, int32_t digits);
const char * ec_fop_name(int32_t id);
void ec_trace(const char * event, ec_fop_data_t * fop, const char * fmt, ...);
-int32_t ec_bits_count(uint64_t n);
-int32_t ec_bits_index(uint64_t n);
int32_t ec_bits_consume(uint64_t * n);
size_t ec_iov_copy_to(void * dst, struct iovec * vector, int32_t count,
off_t offset, size_t size);