summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.h
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2010-03-01 17:47:06 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-04 02:04:20 -0800
commit1ce31a9a12a17b0dc3a2a0d99f3a6cfa00852cea (patch)
treecefc74f16871d755e5fe1da95dbef9ba2534c49a /xlators/cluster/afr/src/afr.h
parent631f413ab484849ca15e094ac97e49c411b8a1a6 (diff)
cluster/afr: Failover readdir calls.
This patch makes the replicate readdir call fail over to the next subvolume if the first call fails. It takes care to ensure that entries are not duplicated. The failover behavior of readdir only comes into effect if the option 'strict-readdir' is on. Signed-off-by: Vikas Gorur <vikas@dev.gluster.com> Signed-off-by: root <root@client02.(none)> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 453 (afr_readdir does not fail over) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=453
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r--xlators/cluster/afr/src/afr.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 71f4b7e56..a5c75add7 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -67,6 +67,8 @@ typedef struct _afr_private {
unsigned int metadata_lock_server_count;
unsigned int entry_lock_server_count;
+ gf_boolean_t strict_readdir;
+
unsigned int wait_count; /* # of servers to wait for success */
uint64_t up_count; /* number of CHILD_UPs we have seen */
@@ -327,6 +329,7 @@ typedef struct _afr_local {
size_t size;
off_t offset;
+ gf_boolean_t failed;
int last_tried;
} readdir;
@@ -547,6 +550,10 @@ typedef struct {
int32_t wbflags;
uint64_t up_count; /* number of CHILD_UPs this fd has seen */
uint64_t down_count; /* number of CHILD_DOWNs this fd has seen */
+
+ int32_t last_tried;
+ gf_boolean_t failed_over;
+ struct list_head entries; /* needed for readdir failover */
} afr_fd_ctx_t;