summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/changelog')
-rw-r--r--xlators/features/changelog/src/changelog-helpers.c33
-rw-r--r--xlators/features/changelog/src/changelog.c3
2 files changed, 26 insertions, 10 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c
index 7e518f1a0c7..2c0a6457e8e 100644
--- a/xlators/features/changelog/src/changelog-helpers.c
+++ b/xlators/features/changelog/src/changelog-helpers.c
@@ -327,11 +327,21 @@ htime_update (xlator_t *this,
sprintf (x_value,"%lu:%d",ts, priv->rollover_count);
if (sys_fsetxattr (priv->htime_fd, HTIME_KEY, x_value,
- strlen (x_value), XATTR_REPLACE)) {
+ strlen (x_value), XATTR_REPLACE)) {
gf_log (this->name, GF_LOG_ERROR,
- "Htime xattr updation failed, "
- "reason (%s)",strerror (errno));
- goto out;
+ "Htime xattr updation failed with XATTR_REPLACE "
+ "Changelog: %s Reason (%s)", changelog_path,
+ strerror (errno));
+
+ if (sys_fsetxattr (priv->htime_fd, HTIME_KEY, x_value,
+ strlen (x_value), 0)) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Htime xattr updation failed "
+ "Changelog: %s Reason (%s)", changelog_path,
+ strerror (errno));
+ ret = -1;
+ goto out;
+ }
}
priv->rollover_count +=1;
@@ -633,17 +643,21 @@ htime_open (xlator_t *this,
size = sys_fgetxattr (ht_dir_fd, HTIME_CURRENT, ht_file_bname,
sizeof (ht_file_bname));
if (size < 0) {
- gf_log (this->name, GF_LOG_ERROR, "Error extracting"
- " HTIME_CURRENT: %s.", strerror (errno));
-
/* If upgrade scenario, find the latest HTIME.TSTAMP file
* and use the same. If error, create a new HTIME.TSTAMP
* file.
*/
cnt = find_current_htime (ht_dir_fd, ht_dir_path,
ht_file_bname);
- if (cnt <= 0)
+ if (cnt <= 0) {
+ gf_log (this->name, GF_LOG_INFO,
+ "HTIME_CURRENT not found: %s. Changelog enabled"
+ " before init", strerror (errno));
return htime_create (this, priv, ts);
+ }
+
+ gf_log (this->name, GF_LOG_ERROR, "Error extracting"
+ " HTIME_CURRENT: %s.", strerror (errno));
}
gf_log (this->name, GF_LOG_INFO, "HTIME_CURRENT: %s", ht_file_bname);
@@ -701,6 +715,9 @@ htime_create (xlator_t *this,
char ht_file_bname[NAME_MAX + 1] = {0,};
int flags = 0;
+ gf_log (this->name, GF_LOG_INFO, "Changelog enable: Creating new "
+ "HTIME.%lu file", ts);
+
CHANGELOG_FILL_HTIME_DIR(priv->changelog_dir, ht_dir_path);
/* get the htime file name in ht_file_path */
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index bea733450c8..47696f44678 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -2423,8 +2423,7 @@ reconfigure (xlator_t *this, dict_t *options)
if (active_now) {
if (!active_earlier) {
gf_log (this->name, GF_LOG_INFO,
- "Changelog enable: Creating new "
- "HTIME.TSTAMP file");
+ "Reconfigure: Changelog Enable");
if (gettimeofday(&tv, NULL) ) {
gf_log (this->name, GF_LOG_ERROR,
"unable to fetch htime");