summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorJoseph Fernandes <josferna@redhat.com>2015-11-21 01:04:21 +0530
committerDan Lambright <dlambrig@redhat.com>2015-11-26 09:19:35 -0800
commitaa775565bf7302d98da66e49ed063aab1698b282 (patch)
tree485d4983a14de5f5237a36dd5d3dc8f122e19054 /libglusterfs
parent5a52abb4af0d2d36e1b24e80cbfd349a9442a329 (diff)
tier/ctr: Correcting rename logic
Problem: When a file with old_file_name and GFID_1 is renamed with a new_file_name which already exists and with GFID_2, this is what happens in linux internaly. a. "new_file_name" is unlinked for GFID_2 b. a hardlink "new_file_name" is created to GFID_1 c. "old_file_name" hardlink is unlinked for GFID_2. Well this is all internal to linux, and gluster just issues a rename system call at POSIX layer. But CTR Xlator doesn't delete the entries corresponding to the "new_file_name" and GFID_2. Thus leaving the stale entry in the DB. The following are the implications. a. Promotion are tried on these stale entries which will fail and show false results in the status of migration, b. GFID_2 Files with 2 hardlinks, which will have only one hardlink after the rename will not be promoted or demoted as the DB shows 2 entries. Solution: Delete the older database entry for the replaced hardlink Backport of http://review.gluster.org/12711 > Change-Id: I4eafa0872253e29ff1f0bec4283bcfc579ecf0e2 > BUG: 1284090 > Signed-off-by: Joseph Fernandes <josferna@redhat.com> > Reviewed-on: http://review.gluster.org/12711 > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Dan Lambright <dlambrig@redhat.com> > Tested-by: Dan Lambright <dlambrig@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Change-Id: Ic35348303ec21f9bd19f20a48f3141449349668b BUG: 1285688 Reviewed-on: http://review.gluster.org/12762 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/gfdb/gfdb_data_store_types.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_data_store_types.h b/libglusterfs/src/gfdb/gfdb_data_store_types.h
index ce09e731746..d79bf41a8c9 100644
--- a/libglusterfs/src/gfdb/gfdb_data_store_types.h
+++ b/libglusterfs/src/gfdb/gfdb_data_store_types.h
@@ -268,13 +268,20 @@ isdentrycreatefop(gfdb_fop_type_t fop_type)
/*The structure that is used to send insert/update the databases
* using insert_db api*/
typedef struct gfdb_db_record {
+ /* GFID */
uuid_t gfid;
+ /* Used during a rename refer ctr_rename() in changetimerecorder
+ * xlator*/
+ uuid_t old_gfid;
+ /* Parent GFID */
uuid_t pargfid;
uuid_t old_pargfid;
- char file_name[PATH_MAX];
+ /* File names and paths */
+ char file_name[GF_NAME_MAX];
char file_path[PATH_MAX];
- char old_file_name[PATH_MAX];
+ char old_file_name[GF_NAME_MAX];
char old_path[PATH_MAX];
+ /* FOP type and FOP path*/
gfdb_fop_type_t gfdb_fop_type;
gfdb_fop_path_t gfdb_fop_path;
/*Time of change or access*/