summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal.h
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-09-14 11:29:15 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-10-05 12:17:05 +0000
commitc0d4b32cb028e8b4928ace22468d692fb7e42ca4 (patch)
treec55668d6fd1dc7b62588ca320db6546a04f674f3 /xlators/cluster/afr/src/afr-self-heal.h
parent761942e9fe8f6d7bbd5c56720e52dc4f6663cd9f (diff)
afr: auto-resolve split-brains for zero-byte files
Problems: As described in BZ 1491670, renaming hardlinks can result in data/mdata split-brain of the DHT link-to files (T files) without any mismatch of data and metadata. As described in BZ 1486063, for a zero-byte file with only dirty bits set, arbiter brick will likely be chosen as the source brick. Fix: For zero byte files in split-brain, pick first brick as a) data source if file size is zero on all bricks. b) metadata source if metadata is the same on all bricks In arbiter case, if file size is zero on all bricks and there are no pending afr xattrs, pick 1st brick as data source. (cherry picked from commit 1719cffa911c5287715abfdb991bc8862f0c994e) Change-Id: I0270a9a2f97c3b21087e280bb890159b43975e04 BUG: 1496317 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reported-by: Rahul Hinduja <rhinduja@redhat.com> Reported-by: Mabi <mabi@protonmail.ch>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal.h')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal.h b/xlators/cluster/afr/src/afr-self-heal.h
index c501852ba5f..f7c4695cd46 100644
--- a/xlators/cluster/afr/src/afr-self-heal.h
+++ b/xlators/cluster/afr/src/afr-self-heal.h
@@ -342,4 +342,12 @@ afr_gfid_split_brain_source (xlator_t *this, struct afr_reply *replies,
int src_idx, int child_idx,
unsigned char *locked_on, int *src, dict_t *xdata);
+int
+afr_mark_source_sinks_if_file_empty (xlator_t *this, unsigned char *sources,
+ unsigned char *sinks,
+ unsigned char *healed_sinks,
+ unsigned char *locked_on,
+ struct afr_reply *replies,
+ afr_transaction_type type);
+
#endif /* !_AFR_SELFHEAL_H */