diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2017-05-08 21:10:50 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-07-03 12:50:31 +0000 |
commit | a8d7d4dac391c74ef3e34512c387565ab30c0a90 (patch) | |
tree | 94f2f91d4a7e5abcfbbd08e0560e064fd632d6a1 | |
parent | 4328d6412d30ce538ec87e1f124ebe3b2a0e131e (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
Backport of>
>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>
Change-Id: Ia75538ad1fd2797dbcf90d20dfa89f756009243d
BUG: 1463513
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: https://review.gluster.org/17587
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
-rw-r--r-- | xlators/features/changelog/src/changelog-misc.h | 7 | ||||
-rw-r--r-- | xlators/features/changelog/src/changelog.c | 17 |
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 8112d42d316..a05aec9cc30 100644 --- a/xlators/features/changelog/src/changelog.c +++ b/xlators/features/changelog/src/changelog.c @@ -1302,7 +1302,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); @@ -1356,7 +1356,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); @@ -1412,7 +1412,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); @@ -1533,7 +1533,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); @@ -1648,7 +1648,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); @@ -2336,9 +2336,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 */ |