|
|
21ab4e |
From d0962cccbb5e5239d2993e7c0dadfd97524f81f9 Mon Sep 17 00:00:00 2001
|
|
|
21ab4e |
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
21ab4e |
Date: Mon, 8 May 2017 21:10:50 +0530
|
|
|
21ab4e |
Subject: [PATCH 447/473] features/changelog: Add xattr as special type in
|
|
|
21ab4e |
changelog entry
|
|
|
21ab4e |
|
|
|
21ab4e |
When both SETATTR and SETXATTR fops are happening on gfid within the
|
|
|
21ab4e |
rollover time then, SETXATTR were not logged.
|
|
|
21ab4e |
In Which case we will miss the xattr fop in slave.
|
|
|
21ab4e |
|
|
|
21ab4e |
This patch will be fix the same
|
|
|
21ab4e |
|
|
|
21ab4e |
Backport of>
|
|
|
21ab4e |
>Change-Id: Ia75538ad1fd2797dbcf90d20dfa89f756009243d
|
|
|
21ab4e |
>BUG: 1448914
|
|
|
21ab4e |
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
21ab4e |
>Reviewed-on: https://review.gluster.org/17205
|
|
|
21ab4e |
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>Reviewed-by: Kotresh HR <khiremat@redhat.com>
|
|
|
21ab4e |
>Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
|
|
|
21ab4e |
Change-Id: Ia75538ad1fd2797dbcf90d20dfa89f756009243d
|
|
|
21ab4e |
BUG: 1426952
|
|
|
21ab4e |
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
21ab4e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/106337
|
|
|
21ab4e |
Reviewed-by: Kotresh Hiremath Ravishankar <khiremat@redhat.com>
|
|
|
21ab4e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
---
|
|
|
21ab4e |
xlators/features/changelog/src/changelog-misc.h | 7 ++++---
|
|
|
21ab4e |
xlators/features/changelog/src/changelog.c | 17 +++++++++--------
|
|
|
21ab4e |
2 files changed, 13 insertions(+), 11 deletions(-)
|
|
|
21ab4e |
|
|
|
21ab4e |
diff --git a/xlators/features/changelog/src/changelog-misc.h b/xlators/features/changelog/src/changelog-misc.h
|
|
|
21ab4e |
index 778f79c..94d6c50 100644
|
|
|
21ab4e |
--- a/xlators/features/changelog/src/changelog-misc.h
|
|
|
21ab4e |
+++ b/xlators/features/changelog/src/changelog-misc.h
|
|
|
21ab4e |
@@ -14,7 +14,7 @@
|
|
|
21ab4e |
#include "glusterfs.h"
|
|
|
21ab4e |
#include "common-utils.h"
|
|
|
21ab4e |
|
|
|
21ab4e |
-#define CHANGELOG_MAX_TYPE 3
|
|
|
21ab4e |
+#define CHANGELOG_MAX_TYPE 4
|
|
|
21ab4e |
#define CHANGELOG_FILE_NAME "CHANGELOG"
|
|
|
21ab4e |
#define HTIME_FILE_NAME "HTIME"
|
|
|
21ab4e |
#define CSNAP_FILE_NAME "CHANGELOG.SNAP"
|
|
|
21ab4e |
@@ -95,14 +95,15 @@
|
|
|
21ab4e |
strcat (path, "/csnap"); \
|
|
|
21ab4e |
} while(0)
|
|
|
21ab4e |
/**
|
|
|
21ab4e |
- * everything after 'CHANGELOG_TYPE_ENTRY' are internal types
|
|
|
21ab4e |
+ * everything after 'CHANGELOG_TYPE_METADATA_XATTR' are internal types
|
|
|
21ab4e |
* (ie. none of the fops trigger this type of event), hence
|
|
|
21ab4e |
- * CHANGELOG_MAX_TYPE = 3
|
|
|
21ab4e |
+ * CHANGELOG_MAX_TYPE = 4
|
|
|
21ab4e |
*/
|
|
|
21ab4e |
typedef enum {
|
|
|
21ab4e |
CHANGELOG_TYPE_DATA = 0,
|
|
|
21ab4e |
CHANGELOG_TYPE_METADATA,
|
|
|
21ab4e |
CHANGELOG_TYPE_ENTRY,
|
|
|
21ab4e |
+ CHANGELOG_TYPE_METADATA_XATTR,
|
|
|
21ab4e |
CHANGELOG_TYPE_ROLLOVER,
|
|
|
21ab4e |
CHANGELOG_TYPE_FSYNC,
|
|
|
21ab4e |
} changelog_log_type;
|
|
|
21ab4e |
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
|
|
|
21ab4e |
index dddeb45..e74da78 100644
|
|
|
21ab4e |
--- a/xlators/features/changelog/src/changelog.c
|
|
|
21ab4e |
+++ b/xlators/features/changelog/src/changelog.c
|
|
|
21ab4e |
@@ -1300,7 +1300,7 @@ changelog_fremovexattr_cbk (call_frame_t *frame,
|
|
|
21ab4e |
|
|
|
21ab4e |
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
|
|
|
21ab4e |
|
|
|
21ab4e |
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
|
|
|
21ab4e |
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
|
|
|
21ab4e |
|
|
|
21ab4e |
unwind:
|
|
|
21ab4e |
changelog_dec_fop_cnt (this, priv, local);
|
|
|
21ab4e |
@@ -1354,7 +1354,7 @@ changelog_removexattr_cbk (call_frame_t *frame,
|
|
|
21ab4e |
|
|
|
21ab4e |
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
|
|
|
21ab4e |
|
|
|
21ab4e |
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
|
|
|
21ab4e |
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
|
|
|
21ab4e |
|
|
|
21ab4e |
unwind:
|
|
|
21ab4e |
changelog_dec_fop_cnt (this, priv, local);
|
|
|
21ab4e |
@@ -1410,7 +1410,7 @@ changelog_setxattr_cbk (call_frame_t *frame,
|
|
|
21ab4e |
|
|
|
21ab4e |
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
|
|
|
21ab4e |
|
|
|
21ab4e |
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
|
|
|
21ab4e |
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
|
|
|
21ab4e |
|
|
|
21ab4e |
unwind:
|
|
|
21ab4e |
changelog_dec_fop_cnt (this, priv, local);
|
|
|
21ab4e |
@@ -1531,7 +1531,7 @@ changelog_fsetxattr_cbk (call_frame_t *frame,
|
|
|
21ab4e |
|
|
|
21ab4e |
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
|
|
|
21ab4e |
|
|
|
21ab4e |
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
|
|
|
21ab4e |
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
|
|
|
21ab4e |
|
|
|
21ab4e |
unwind:
|
|
|
21ab4e |
changelog_dec_fop_cnt (this, priv, local);
|
|
|
21ab4e |
@@ -1646,7 +1646,7 @@ changelog_fxattrop_cbk (call_frame_t *frame,
|
|
|
21ab4e |
|
|
|
21ab4e |
CHANGELOG_COND_GOTO (priv, ((op_ret < 0) || !local), unwind);
|
|
|
21ab4e |
|
|
|
21ab4e |
- changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA);
|
|
|
21ab4e |
+ changelog_update (this, priv, local, CHANGELOG_TYPE_METADATA_XATTR);
|
|
|
21ab4e |
|
|
|
21ab4e |
unwind:
|
|
|
21ab4e |
changelog_dec_fop_cnt (this, priv, local);
|
|
|
21ab4e |
@@ -2340,9 +2340,10 @@ changelog_init (xlator_t *this, changelog_priv_t *priv)
|
|
|
21ab4e |
|
|
|
21ab4e |
priv->slice.tv_start = tv;
|
|
|
21ab4e |
|
|
|
21ab4e |
- priv->maps[CHANGELOG_TYPE_DATA] = "D ";
|
|
|
21ab4e |
- priv->maps[CHANGELOG_TYPE_METADATA] = "M ";
|
|
|
21ab4e |
- priv->maps[CHANGELOG_TYPE_ENTRY] = "E ";
|
|
|
21ab4e |
+ priv->maps[CHANGELOG_TYPE_DATA] = "D ";
|
|
|
21ab4e |
+ priv->maps[CHANGELOG_TYPE_METADATA] = "M ";
|
|
|
21ab4e |
+ priv->maps[CHANGELOG_TYPE_METADATA_XATTR] = "M ";
|
|
|
21ab4e |
+ priv->maps[CHANGELOG_TYPE_ENTRY] = "E ";
|
|
|
21ab4e |
|
|
|
21ab4e |
for (; i < CHANGELOG_MAX_TYPE; i++) {
|
|
|
21ab4e |
/* start with version 1 */
|
|
|
21ab4e |
--
|
|
|
21ab4e |
1.8.3.1
|
|
|
21ab4e |
|