summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/src/changelog-helpers.h
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-05-09 16:54:00 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-06-16 09:03:15 -0700
commit650459c4178eff6fba82351d044c995ab7d046b1 (patch)
treef8c1f3516fdb1c923ef8e8af29513f7287d7a860 /xlators/features/changelog/src/changelog-helpers.h
parentdca4de364cd948ec7dade4416425ea1353911066 (diff)
features/changelog: Change barrier notification mechanism
Backport of http://review.gluster.org/14272 The barrier notification mechanism was fd based and 'select' was being used. 'select' breaks when number of fds opened by brick process exceeds 1024. To avoid this and also the maintainance of pipe between notify and 'changelog_rollover', the pipe has been replaced with pthread condition signal and timed wait mechanism. Change-Id: I530ea90d9a06953f8b23b4e12d122872ee1925de BUG: 1341952 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/14615 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog-helpers.h')
-rw-r--r--xlators/features/changelog/src/changelog-helpers.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h
index 1d548ca..3f77ed5 100644
--- a/xlators/features/changelog/src/changelog-helpers.h
+++ b/xlators/features/changelog/src/changelog-helpers.h
@@ -115,8 +115,9 @@ typedef struct changelog_rollover {
xlator_t *this;
- /* read end of pipe used as event from barrier on snapshot */
- int rfd;
+ pthread_mutex_t lock;
+ pthread_cond_t cond;
+ gf_boolean_t notify;
} changelog_rollover_t;
typedef struct changelog_fsync {
@@ -264,9 +265,6 @@ struct changelog_priv {
/* Represents the active color. Initially by default black */
chlog_fop_color_t current_color;
- /* write end of pipe to do explicit rollover on barrier during snap */
- int cr_wfd;
-
/* flag to determine explicit rollover is triggered */
gf_boolean_t explicit_rollover;