summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/src/changelog.c
diff options
context:
space:
mode:
authorKotresh H R <khiremat@redhat.com>2014-06-28 12:18:52 +0530
committerVenky Shankar <vshankar@redhat.com>2014-06-30 04:25:48 -0700
commit2417de9c37d83e36567551dc682bb23f851fd2d7 (patch)
tree22454ed7506b1d484e52dc7107ff5821560a2fdd /xlators/features/changelog/src/changelog.c
parentfe59c3485406cda02950e20f57d0ecc0cf964546 (diff)
feature/changelog: Fix for missing changelogs at backend.
Problem: A few changelog files are missing at the backend during snapshot with changelog enabled. Cause: Race between actual rollover and explicit rollover. Changelog rollover can happen either due to actual or the explict rollover due to snapshot. Actual rollover is controlled by tuneable called rollover-time. The minimum granularity for rollover-time is 1 second Explicit rollover is asynchronous in nature and happens during snapshot. Basically, rollover renames the current CHANGELOG file to CHANGELOG.TIMESTAMP after rollover-time. Let's assume, at time 't1', actual and explicit rollover raced against each other and actual rollover won the race renaming the CHANGELOG file to CHANGELOG.t1 and opens a new CHANGELOG file. An immediate explicit rollover at time 't1' happened with in the same second to rename CHANGELOG file to CHANGELOG.t1 resulting in purging the earlier CHANGELOG.t1 file created by actual rollover. Solution: Adding a delay of 1 sec guarantees unique CHANGELOG.TIMESTAMP during explicit rollover. Thanks Venky, for the all the help in root causing the issue. Change-Id: I8958824e107e16f61be9f09a11d95f8645ecf34d BUG: 1109692 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8196 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/changelog/src/changelog.c')
-rw-r--r--xlators/features/changelog/src/changelog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index 43458006d13..bbf05ba48c1 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -1499,7 +1499,7 @@ notify (xlator_t *this, int event, void *data, ...)
*/
if (ret == 0) {
chlog_barrier_dequeue_all(this, &queue);
- gf_log(this->name, GF_LOG_DEBUG,
+ gf_log(this->name, GF_LOG_INFO,
"Disabled changelog barrier");
} else {
gf_log (this->name, GF_LOG_ERROR,
@@ -1557,7 +1557,7 @@ notify (xlator_t *this, int event, void *data, ...)
goto out;
}
- gf_log(this->name, GF_LOG_DEBUG,
+ gf_log(this->name, GF_LOG_INFO,
"Enabled changelog barrier");
ret = changelog_barrier_notify(priv, buf);