From 8bd16cc88527584e91baa8773b4f01e7c44708c1 Mon Sep 17 00:00:00 2001 From: ajha Date: Fri, 30 Aug 2013 15:14:46 +0530 Subject: features/changelog : Improvement in changelog "encoding-change". change in encoding method of changelog was critical section for "fop dispatch thread", "roll-over thread" and "reconfigure dispatch thread". In this patch the "encoding-method" is changed by the reconfigure dispatch thread lazily during handle_change, which solves the concurrency among the racing threads. BUG: 1002940 Change-Id: I78c3e8887efa46d0fcc60755cdf4243031cfa3eb Signed-off-by: Ajeet Jha Reviewed-on: http://review.gluster.org/5844 Reviewed-by: Venky Shankar Tested-by: Gluster Build System Reviewed-by: Harshavardhana --- xlators/features/changelog/src/changelog-helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/features/changelog/src/changelog-helpers.c') diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c index c1bb6e5fef9..7ab0091b592 100644 --- a/xlators/features/changelog/src/changelog-helpers.c +++ b/xlators/features/changelog/src/changelog-helpers.c @@ -21,6 +21,7 @@ #include "changelog-helpers.h" #include "changelog-mem-types.h" +#include "changelog-encoders.h" #include void @@ -201,7 +202,7 @@ changelog_open (xlator_t *this, (void) snprintf (buffer, 1024, CHANGELOG_HEADER, CHANGELOG_VERSION_MAJOR, CHANGELOG_VERSION_MINOR, - priv->encode_mode); + priv->ce->encoder); ret = changelog_write_change (priv, buffer, strlen (buffer)); if (ret) { close (priv->changelog_fd); @@ -267,6 +268,7 @@ changelog_handle_change (xlator_t *this, int ret = 0; if (CHANGELOG_TYPE_IS_ROLLOVER (cld->cld_type)) { + changelog_encode_change(priv); ret = changelog_start_next_change (this, priv, cld->cld_roll_time, cld->cld_finale); -- cgit