summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh H R <khiremat@redhat.com>2014-06-16 12:30:39 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-16 04:23:37 -0700
commit62265f40d7201854dbf33d59a74286dda671a129 (patch)
tree65f495f8272768e68ee8758a0aea2695cf2b72db
parent452eea5c43ee5af450e91f240860551af6aba241 (diff)
features/changelog: Do not ignore self-heal fops in changelog
Problem: Geo-rep fails to sync some files to slave as the changelog entries are missing for those files. Cause: Fops happened when the active brick is down and self- healed later when it came up. Solution: Capture self-heal fops as well in changelog so those entries are not missed. Change-Id: Ibc288779421b5156dd1695e529aba0b602a530e0 BUG: 1109692 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/8070 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/features/changelog/src/changelog-helpers.h7
-rw-r--r--xlators/features/changelog/src/changelog.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h
index 03108d36f7d..95f369bf936 100644
--- a/xlators/features/changelog/src/changelog-helpers.h
+++ b/xlators/features/changelog/src/changelog-helpers.h
@@ -522,9 +522,10 @@ int __chlog_barrier_enable (xlator_t *this, changelog_priv_t *priv);
} while (0)
/* ignore internal fops */
-#define CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO(dict, label) do { \
- if (dict && dict_get (dict, GLUSTERFS_INTERNAL_FOP_KEY)) \
- goto label; \
+#define CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label) do { \
+ if ((frame->root->pid > 0) && \
+ dict && dict_get (dict, GLUSTERFS_INTERNAL_FOP_KEY)) \
+ goto label; \
} while (0)
#define CHANGELOG_COND_GOTO(priv, cond, label) do { \
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index 42292352b72..43458006d13 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -217,7 +217,7 @@ changelog_unlink (call_frame_t *frame, xlator_t *this,
priv = this->private;
CHANGELOG_NOT_ACTIVE_THEN_GOTO (frame, priv, wind);
- CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO (xdata, wind);
+ CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO (frame, xdata, wind);
CHANGELOG_INIT_NOCHECK (this, frame->local, NULL, loc->inode->gfid, 2);
@@ -428,7 +428,7 @@ changelog_link (call_frame_t *frame,
priv = this->private;
CHANGELOG_NOT_ACTIVE_THEN_GOTO (frame, priv, wind);
- CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO (xdata, wind);
+ CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO (frame, xdata, wind);
CHANGELOG_INIT_NOCHECK (this, frame->local, NULL, oldloc->gfid, 2);
@@ -642,6 +642,7 @@ changelog_mknod (call_frame_t *frame,
priv = this->private;
CHANGELOG_NOT_ACTIVE_THEN_GOTO (frame, priv, wind);
+ CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO (frame, xdata, wind);
ret = dict_get_ptr (xdata, "gfid-req", &uuid_req);
if (ret) {