diff options
author | Kotresh HR <khiremat@redhat.com> | 2015-05-27 16:27:25 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2015-05-31 07:48:19 -0700 |
commit | d76e9b83454786e6845d0cad3c2c0695815fae1b (patch) | |
tree | 49a6b154215fb8e23567363b1db05d3495915b98 /xlators/features/changelog/src/changelog.c | |
parent | ad7bd0865db4653e609bfc08cfc50225c87f3748 (diff) |
featuress/changelog: On snapshot, notify irrespective of failures
During snapshot, changelog barrier is enabled and a
explicit rollover of changelog is initiated. During
rollover of changelog, if any error or changelog is
empty, the notification was not sent to reconfigure
and hence snapshot was failing because of timeout.
This patch addresses it by sending notification
irrespective of failures and sends error if any
back to barrier.
Change-Id: I898af624b44555281a9e43c69066077e0e121c17
BUG: 1225542
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/10951
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog.c')
-rw-r--r-- | xlators/features/changelog/src/changelog.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c index 91b0ae7a6e5..ed29bb83556 100644 --- a/xlators/features/changelog/src/changelog.c +++ b/xlators/features/changelog/src/changelog.c @@ -1958,6 +1958,7 @@ notify (xlator_t *this, int event, void *data, ...) int barrier = DICT_DEFAULT; gf_boolean_t bclean_req = _gf_false; int ret = 0; + int ret1 = 0; struct list_head queue = {0, }; INIT_LIST_HEAD (&queue); @@ -2108,13 +2109,17 @@ notify (xlator_t *this, int event, void *data, ...) out, bclean_req); } + if (priv->bn.bnotify_error == _gf_true) { + ret = -1; + priv->bn.bnotify_error = _gf_false; + } } - ret = pthread_mutex_unlock (&priv->bn.bnotify_mutex); - CHANGELOG_PTHREAD_ERROR_HANDLE_1 (ret, out, bclean_req); + ret1 = pthread_mutex_unlock (&priv->bn.bnotify_mutex); + CHANGELOG_PTHREAD_ERROR_HANDLE_1 (ret1, out, + bclean_req); gf_log (this->name, GF_LOG_INFO, "Woke up: bnotify conditional wait"); - ret = 0; goto out; case DICT_DEFAULT: @@ -2632,6 +2637,7 @@ init (xlator_t *this) /* Mutex is not needed as threads are not spawned yet */ priv->bn.bnotify = _gf_false; + priv->bn.bnotify_error = _gf_false; ret = changelog_barrier_pthread_init (this, priv); if (ret) goto cleanup_options; |