diff options
author | Joseph Fernandes <josferna@redhat.com> | 2015-11-08 15:33:15 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2015-11-16 07:42:42 -0800 |
commit | a1aa8e72b026f4abbec743d6a12ab42263ccdaee (patch) | |
tree | 6865fcc9418eba164f6d4272aac752e40282b809 /libglusterfs | |
parent | cc7367bcde55c315a299aa97d521d25424f15e76 (diff) |
tier/ctr: Providing option to record or ignore metadata heat
Currently we heat up a file for both data and metadata write.
Here we provide a ctr xlator option called "ctr-record-metadata-heat"
were the admin can decide on recording metadata heat i.e heatup a
file on metadata writes or not.
Metadata data operation are
a. setattr: explicit changing of atime/mtime using utimes,
changing of posix permissions of the file
b. rename: Renaming a file,
c. unlink, link: adding or deleting hardlinks
d. xattrs: setting or removal of xattrs.
NOTE: atime, mtime and ctime change through writev, readv, truncate, mknod
and create will not be considered here as these fops are data and primary
metadata fops.
Defaultly "ctr-record-metadata-heat" is off. Admin can
switch it on using gluster volume set command.
Backport of http://review.gluster.org/12540
> Change-Id: I91157509255dd5cb429cda2b6d4f64582e155e7b
> BUG: 1279166
> Signed-off-by: Joseph Fernandes <josferna@redhat.com>
> Reviewed-on: http://review.gluster.org/12540
> 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: I986c319f0cc337b0692a1dd02f71254e786afac4
BUG: 1282315
Reviewed-on: http://review.gluster.org/12582
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
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_sqlite3_helper.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c b/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c index cc9658be38c..fde2909b575 100644 --- a/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c +++ b/libglusterfs/src/gfdb/gfdb_sqlite3_helper.c @@ -807,15 +807,33 @@ gf_sql_insert_wind (gf_sql_connection_t *sql_conn, gfdb_db_record->file_name, gfdb_db_record->file_path, gfdb_db_record->link_consistency, - gfdb_db_record->ignore_errors); + _gf_true); if (ret) { gf_msg (GFDB_STR_SQLITE3, - _gfdb_log_level (GF_LOG_ERROR, + _gfdb_log_level (GF_LOG_WARNING, gfdb_db_record->ignore_errors), 0, LG_MSG_INSERT_FAILED, "Failed " "inserting link in DB"); - goto out; + /* Even if link creation is failed we + * continue with the creation of file record. + * This covers to cases + * 1) Lookup heal: If the file record from + * gf_file_tb is deleted but the link record + * still exist. Lookup heal will attempt a heal + * with create_wind set. The link heal will fail + * as there is already a record and if we dont + * ignore the error we will not heal the + * gf_file_tb. + * 2) Rename file in cold tier: During a rename + * of a file that is there in cold tier. We get + * an link record created in hot tier for the + * linkto file. When the file gets heated and + * moves to hot tier there will be attempt from + * ctr lookup heal to create link and file + * record and If we dont ignore the error we + * will not heal the gf_file_tb. + * */ } gfdb_db_record->islinkupdate = gfdb_db_record-> link_consistency; |