diff options
author | Venky Shankar <vshankar@redhat.com> | 2014-07-18 15:36:42 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-08 10:21:17 -0700 |
commit | 0db65a084608a9deb0d0917f084e0d55e23e54a7 (patch) | |
tree | eb5447fb94e95dabaf3ac0af44803970b47dd57b /xlators/features | |
parent | 10aebe1c8be9ab87be233b4c4e6d94279864c461 (diff) |
features/changelog: Capture "correct" internal FOPs
This patch fixes changelog capturing internal FOPs in a cascaded
setup, where the intermediate master would record internal FOPs
(generated by DHT on link()/rename()). This is due to I/O happening
on the intermediate slave on geo-replication's auxillary mount with
client-pid -1. Currently, the internal FOP capturing logic depends
on client pid being non-negative and the presence of a special key
in dictionary. Due to this, internal FOPs on an inter-mediate master
would be recorded in the changelog. Checking client-pid being
non-negative was introduced to capture AFR self-heal traffic in
changelog, thereby breaking cascading setups. By coincidence,
AFR self-heal daemon uses -1 as frame->root->pid thereby making
is hard to differentiate b/w geo-rep's auxillary mount and self-heal
daemon.
BUG: 1138952
Change-Id: Ia08a2cfa3b02bb785f343794f5b2695d44398c4c
Original-Author: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Kotresh H R <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/8347
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Reviewed-on: http://review.gluster.org/8638
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/changelog/src/changelog-helpers.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h index d4af1ff3445..9bd4a3ff37c 100644 --- a/xlators/features/changelog/src/changelog-helpers.h +++ b/xlators/features/changelog/src/changelog-helpers.h @@ -539,11 +539,14 @@ int __chlog_barrier_enable (xlator_t *this, changelog_priv_t *priv); goto label; \ } while (0) -/* ignore internal fops */ -#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; \ +/** + * ignore internal fops for all clients except AFR self-heal daemon + */ +#define CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label) do { \ + if ((frame->root->pid != GF_CLIENT_PID_AFR_SELF_HEALD) \ + && dict \ + && dict_get (dict, GLUSTERFS_INTERNAL_FOP_KEY)) \ + goto label; \ } while (0) #define CHANGELOG_COND_GOTO(priv, cond, label) do { \ |