diff options
author | Joseph Fernandes <josferna@redhat.com> | 2015-04-09 15:07:54 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-05-01 09:10:30 -0700 |
commit | 4d118cb5ee99b8401d70678fc3b3576ad938999d (patch) | |
tree | ba69360a1d9f416193916a84676cc43a4d3c64ed /xlators/features/changetimerecorder | |
parent | cfb9ea4dc68440a18b7f07422901a715b00776f0 (diff) |
ctr/libgfdb: Performance enhancer for unlink/create/rename/link fops
1) ctr_link_consistency option for ctr xaltor is provided so that
the user can choose to switch it on or off.
/* For link consistency we do a double update i.e mark the link
* during the wind and during the unwind we update/delete the link.
* This has a performance hit. We give a choice here whether we need
* link consistency to be spoton or not using link_consistency flag.
* This will have only one link update */
2) In delete the wind time recording is moved to unwind path.
/* Special performance case:
* Updating wind time in unwind for delete. This is done here
* as in the wind path we will not know whether its the last
* link or not. For a last link there is not use to update any
* wind or unwind time!*/
Change-Id: I209472fb816f939db4a868b97ba053b028f17ea6
BUG: 1217786
Signed-off-by: Joseph Fernandes <josferna@redhat.com>
Reviewed-on: http://review.gluster.org/10170
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/changetimerecorder')
-rw-r--r-- | xlators/features/changetimerecorder/src/changetimerecorder.c | 8 | ||||
-rw-r--r-- | xlators/features/changetimerecorder/src/ctr-helper.c | 5 | ||||
-rw-r--r-- | xlators/features/changetimerecorder/src/ctr-helper.h | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/xlators/features/changetimerecorder/src/changetimerecorder.c b/xlators/features/changetimerecorder/src/changetimerecorder.c index 42470a92ef9..fd57a445e08 100644 --- a/xlators/features/changetimerecorder/src/changetimerecorder.c +++ b/xlators/features/changetimerecorder/src/changetimerecorder.c @@ -958,6 +958,9 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("record-counters", _priv->ctr_record_counter, options, bool, out); + GF_OPTION_RECONF ("ctr_link_consistency", _priv->ctr_link_consistency, + options, bool, out); + GF_OPTION_RECONF ("record-exit", _priv->ctr_record_unwind, options, bool, out); @@ -1154,6 +1157,11 @@ struct volume_options options[] = { .value = {"on", "off"}, .default_value = "off" }, + { .key = {"ctr_link_consistency"}, + .type = GF_OPTION_TYPE_BOOL, + .value = {"on", "off"}, + .default_value = "off" + }, { .key = {"hot-brick"}, .type = GF_OPTION_TYPE_BOOL, .value = {"on", "off"}, diff --git a/xlators/features/changetimerecorder/src/ctr-helper.c b/xlators/features/changetimerecorder/src/ctr-helper.c index da5a3deed96..a2e2569818d 100644 --- a/xlators/features/changetimerecorder/src/ctr-helper.c +++ b/xlators/features/changetimerecorder/src/ctr-helper.c @@ -97,6 +97,7 @@ fill_db_record_for_wind (xlator_t *this, ctr_wtime = &CTR_DB_REC(ctr_local).gfdb_wind_change_time; CTR_DB_REC(ctr_local).gfdb_fop_path = ctr_inode_cx->fop_path; CTR_DB_REC(ctr_local).gfdb_fop_type = ctr_inode_cx->fop_type; + CTR_DB_REC(ctr_local).link_consistency = _priv->ctr_link_consistency; ret = gettimeofday (ctr_wtime, NULL); if (ret) { @@ -265,6 +266,10 @@ int extract_ctr_options (xlator_t *this, gf_ctr_private_t *_priv) { GF_OPTION_INIT ("record-counters", _priv->ctr_record_counter, bool, out); + /*Extract flag for link consistency*/ + GF_OPTION_INIT ("ctr_link_consistency", _priv->ctr_link_consistency, + bool, out); + /*Extract flag for hot tier brick*/ GF_OPTION_INIT ("hot-brick", _priv->ctr_hot_brick, bool, out); diff --git a/xlators/features/changetimerecorder/src/ctr-helper.h b/xlators/features/changetimerecorder/src/ctr-helper.h index 6f4ad5cbe7a..85ee872fa33 100644 --- a/xlators/features/changetimerecorder/src/ctr-helper.h +++ b/xlators/features/changetimerecorder/src/ctr-helper.h @@ -37,6 +37,7 @@ typedef struct gf_ctr_private { gf_boolean_t ctr_record_wind; gf_boolean_t ctr_record_unwind; gf_boolean_t ctr_record_counter; + gf_boolean_t ctr_link_consistency; gfdb_db_type_t gfdb_db_type; gfdb_sync_type_t gfdb_sync_type; gfdb_conn_node_t *_db_conn; @@ -380,6 +381,7 @@ ctr_insert_wind (call_frame_t *frame, "WIND: Error filling ctr local"); goto out; } + /*Insert the db record*/ ret = insert_record (_priv->_db_conn, &ctr_local->gfdb_db_record); |