summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--xlators/features/changelog/src/changelog.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index a0a8befc447..4c213f41576 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -131,6 +131,7 @@
#define QUOTA_SIZE_KEY "trusted.glusterfs.quota.size"
#define GFID_TO_PATH_KEY "glusterfs.gfid2path"
#define GF_XATTR_STIME_PATTERN "trusted.glusterfs.*.stime"
+#define GF_XATTR_TRIGGER_SYNC "glusterfs.geo-rep.trigger-sync"
/* Index xlator related */
#define GF_XATTROP_INDEX_GFID "glusterfs.xattrop_index_gfid"
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index d2e30f7f001..e047288d43d 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -1326,6 +1326,17 @@ changelog_setxattr (call_frame_t *frame,
CHANGELOG_INIT (this, frame->local,
loc->inode, loc->inode->gfid, 1);
+ /* On setting this virtual xattr on a file, an explicit data
+ sync is triggered from geo-rep as DATA entry is recorded
+ in changelog. */
+ if (dict_get (dict, GF_XATTR_TRIGGER_SYNC)
+ && loc->inode->ia_type != IA_IFDIR) {
+ changelog_update (this, priv, frame->local,
+ CHANGELOG_TYPE_DATA);
+ CHANGELOG_STACK_UNWIND (setxattr, frame, 0, 0, xdata);
+ return 0;
+ }
+
co = changelog_get_usable_buffer (frame->local);
if (!co)
goto wind;