summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2017-05-08 21:10:50 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-05-10 12:55:46 +0000
commited27add635263eafb581e5dd1599478d82f0f28a (patch)
tree123826aaae2d2110b0b32577427b5e5f7408508f
parent27b04b6c487e789074eb10c93be0f7d4f58fa945 (diff)
features/changelog: Add xattr as special type in changelog entry
When both SETATTR and SETXATTR fops are happening on gfid within the rollover time then, SETXATTR were not logged. In Which case we will miss the xattr fop in slave. This patch will be fix the same Change-Id: Ia75538ad1fd2797dbcf90d20dfa89f756009243d BUG: 1448914 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: https://review.gluster.org/17205 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--xlators/features/changelog/src/changelog-misc.h7
-rw-r--r--xlators/features/changelog/src/changelog.c17
2 files changed, 13 insertions, 11 deletions
diff --git a/xlators/features/changelog/src/changelog-misc.h b/xlators/features/changelog/src/changelog-misc.h
index 778f79c82c5..94d6c507bd6 100644
--- a/xlators/features/changelog/src/changelog-misc.h
+++ b/xlators/features/changelog/src/changelog-misc.h
@@ -14,7 +14,7 @@
#include "glusterfs.h"
#include "common-utils.h"
-#define CHANGELOG_MAX_TYPE 3
+#define CHANGELOG_MAX_TYPE 4
#define CHANGELOG_FILE_NAME "CHANGELOG"
#define HTIME_FILE_NAME "HTIME"
#define CSNAP_FILE_NAME "CHANGELOG.SNAP"
@@ -95,14 +95,15 @@
strcat (path, "/csnap"); \
} while(0)
/**
- * everything after 'CHANGELOG_TYPE_ENTRY' are internal types
+ * everything after 'CHANGELOG_TYPE_METADATA_XATTR' are internal types
* (ie. none of the fops trigger this type of event), hence
- * CHANGELOG_MAX_TYPE = 3
+ * CHANGELOG_MAX_TYPE = 4
*/
typedef enum {
CHANGELOG_TYPE_DATA = 0,
CHANGELOG_TYPE_METADATA,
CHANGELOG_TYPE_ENTRY,
+ CHANGELOG_TYPE_METADATA_XATTR,
CHANGELOG_TYPE_ROLLOVER,
CHANGELOG_TYPE_FSYNC,
} changelog_log_type;
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index a8bd6bde34b..697e8ca7b11 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -1300,7 +1300,7 @@ changelog_fremovexattr_cbk (call_frame_t *frame,
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
unwind:
changelog_dec_fop_cnt (this, priv, local);
@@ -1354,7 +1354,7 @@ changelog_removexattr_cbk (call_frame_t *frame,
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
unwind:
changelog_dec_fop_cnt (this, priv, local);
@@ -1410,7 +1410,7 @@ changelog_setxattr_cbk (call_frame_t *frame,
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
unwind:
changelog_dec_fop_cnt (this, priv, local);
@@ -1531,7 +1531,7 @@ changelog_fsetxattr_cbk (call_frame_t *frame,
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
unwind:
changelog_dec_fop_cnt (this, priv, local);
@@ -1646,7 +1646,7 @@ changelog_fxattrop_cbk (call_frame_t *frame,
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
unwind:
changelog_dec_fop_cnt (this, priv, local);
@@ -2334,9 +2334,10 @@ changelog_init (xlator_t *this, changelog_priv_t *priv)
priv->slice.tv_start = tv;
- priv->maps[CHANGELOG_TYPE_DATA] = "D ";
- priv->maps[CHANGELOG_TYPE_METADATA] = "M ";
- priv->maps[CHANGELOG_TYPE_ENTRY] = "E ";
+ priv->maps[CHANGELOG_TYPE_DATA] = "D ";
+ priv->maps[CHANGELOG_TYPE_METADATA] = "M ";
+ priv->maps[CHANGELOG_TYPE_METADATA_XATTR] = "M ";
+ priv->maps[CHANGELOG_TYPE_ENTRY] = "E ";
for (; i < CHANGELOG_MAX_TYPE; i++) {
/* start with version 1 */