path: root/libglusterfs
diff options
authorJoseph Fernandes <>2015-11-21 01:04:21 +0530
committerDan Lambright <>2015-11-25 08:21:35 -0800
commit9b151f4ddc2636607b15424c94a09f619f2e5cb8 (patch)
treeb3f8646b4981fd92ef87748c47e3f89898fccea6 /libglusterfs
parent03f731a8b32db7bef7c5e9ffc11c16f670ffe960 (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 Change-Id: I4eafa0872253e29ff1f0bec4283bcfc579ecf0e2 BUG: 1284090 Signed-off-by: Joseph Fernandes <> Reviewed-on: Tested-by: NetBSD Build System <> Tested-by: Gluster Build System <> Reviewed-by: Dan Lambright <> Tested-by: Dan Lambright <>
Diffstat (limited to 'libglusterfs')
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 ce09e73..d79bf41 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*/