diff options
author | Kotresh H R <khiremat@redhat.com> | 2014-05-05 15:33:25 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2014-06-10 03:35:59 -0700 |
commit | b97e8f4ef649ed825b4f02b74e33946f6b551cec (patch) | |
tree | 5a4bd17192b919fd7d19b6b8572f433a36ee56b9 /xlators/features/changelog/src/changelog-helpers.h | |
parent | a9cdfa3072f60171a97d9f6af6988b179d45747f (diff) |
feature/changelog: Add timeout to changelog barrier.
This patch introduces configurable 'changelog-barrier-timeout'
in changelog. The default changelog-barrier-timeout is set to
120 sec which is same as barrier-timeout of barrier translator.
On this timeout, all the barriered fops are unbarriered. It is
safe to have this internal timeout for changelog barrier to
prevent it from indefinite barrierring of fops if barrier
disable notification does not come from snapshot for some
reason.
Change-Id: Iad07807935f88222cdefcd46312b4b6579186dce
BUG: 1094226
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/7669
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog-helpers.h')
-rw-r--r-- | xlators/features/changelog/src/changelog-helpers.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h index 987af190b9c..03108d36f7d 100644 --- a/xlators/features/changelog/src/changelog-helpers.h +++ b/xlators/features/changelog/src/changelog-helpers.h @@ -280,6 +280,9 @@ struct changelog_priv { gf_boolean_t barrier_enabled; struct list_head queue; uint32_t queue_size; + gf_timer_t *timer; + struct timespec timeout; + }; struct changelog_local { @@ -433,6 +436,8 @@ void __chlog_barrier_enqueue (xlator_t *this, call_stub_t *stub); void __chlog_barrier_disable (xlator_t *this, struct list_head *queue); void chlog_barrier_dequeue_all (xlator_t *this, struct list_head *queue); call_stub_t *__chlog_barrier_dequeue (xlator_t *this, struct list_head *queue); +int __chlog_barrier_enable (xlator_t *this, changelog_priv_t *priv); + /* macros */ @@ -563,6 +568,6 @@ call_stub_t *__chlog_barrier_dequeue (xlator_t *this, struct list_head *queue); goto label; \ } \ } while (0) -/* End: Geo-Rep snapshot dependency changes */ +/* End: Geo-Rep snapshot dependency changes */ #endif /* _CHANGELOG_HELPERS_H */ |