diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-11-12 08:44:16 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-11-13 02:13:43 -0800 |
commit | 26fbaa23cafee4643b7604660762656c4a71684b (patch) | |
tree | 90bef7f03cb305dad016439706d46fdd0ed84f62 /xlators/cluster/afr/src/afr.h | |
parent | 4717e5279e169a36a870a267039e788cf22602a8 (diff) |
cluster/afr: Ensure directory contents are in sync during opendir.
The problem: If some files on the first subvolume disappeared
without leaving a trace in the entry changelog (this can happen,
for example, when an fsck has deleted files or when a hard drive
is replaced), those files would never be self-healed even though
they would be present on the second subvolume. This is because
readdir is sent only to the first subvolume, and since the files
don't appear in the directory listing, no lookup would ever be
sent on them.
This patch fixes this problem by doing a readdir on all the subvolumes
during the first opendir on a directory inode. If a discrepancy in the
contents is detected, entry self-heal in a special "force merge" mode
is triggered on that directory.
Signed-off-by: Vikas Gorur <vikas@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 249 (Self heal of a file that does not exist on the first subvolume)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=249
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 45a1c986348..bde151866bf 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -72,6 +72,10 @@ typedef struct _afr_private { } afr_private_t; typedef struct { + /* Is this a self-heal triggered to forcibly merge the + directories? */ + gf_boolean_t forced_merge; + /* array of stat's, one for each child */ struct stat *buf; struct stat parentbuf; @@ -273,6 +277,8 @@ typedef struct _afr_local { int success_count; int32_t op_ret; int32_t op_errno; + + uint32_t *checksum; } opendir; struct { @@ -546,7 +552,11 @@ afr_frame_return (call_frame_t *frame); void afr_set_split_brain (xlator_t *this, inode_t *inode, int32_t split_brain); +void +afr_set_opendir_done (xlator_t *this, inode_t *inode, int32_t opendir_done); +uint64_t +afr_is_opendir_done (xlator_t *this, inode_t *inode); #define AFR_STACK_UNWIND(fop, frame, params ...) \ do { \ |