diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-05-28 15:33:18 +0530 |
---|---|---|
committer | Xavier Hernandez <xhernandez@datalab.es> | 2015-06-23 02:13:40 -0700 |
commit | 653d3c1406e372aabcf694bfead2d695f84ee0f8 (patch) | |
tree | 44f8318978f2ca57629e627a061c661d5e8047a9 | |
parent | e8847bd0ba03616bf80f242fda22e104ff2ea0e3 (diff) |
cluster/ec: Do not handle GF_CONTENT_KEY
GF_CONTENT_KEY aggregation requires that the fragments on the bricks belong to
same data i.e. no operations are modifying the content while lookup is
performed on it. The only way to know it is to get at least ec->fragments+1
number of responses and see that two different sets of ec->fragments number of
fragments give same data. But at the moment we feel that this slows down
ec-lookup. So removing handling of this for now.
Change-Id: I2da5087f1311d5cdde999062607b143b48c17713
BUG: 1226279
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/11003
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
-rw-r--r-- | xlators/cluster/ec/src/ec-generic.c | 92 |
1 files changed, 7 insertions, 85 deletions
diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c index a455dad9f6b..8973241a974 100644 --- a/xlators/cluster/ec/src/ec-generic.c +++ b/xlators/cluster/ec/src/ec-generic.c @@ -698,12 +698,9 @@ out: void ec_lookup_rebuild(ec_t * ec, ec_fop_data_t * fop, ec_cbk_data_t * cbk) { - ec_cbk_data_t * ans = NULL; ec_inode_t * ctx = NULL; - data_t * data = NULL; - uint8_t * buff = NULL; uint64_t size = 0; - int32_t i = 0, have_size = 0; + int32_t have_size = 0; if (cbk->op_ret < 0) { @@ -739,73 +736,12 @@ void ec_lookup_rebuild(ec_t * ec, ec_fop_data_t * fop, ec_cbk_data_t * cbk) if (cbk->iatt[0].ia_type == IA_IFREG) { - uint8_t * blocks[cbk->count]; - uint32_t values[cbk->count]; - cbk->size = cbk->iatt[0].ia_size; ec_dict_del_number(cbk->xdata, EC_XATTR_SIZE, &cbk->iatt[0].ia_size); if (have_size) { cbk->iatt[0].ia_size = size; } - - size = UINT64_MAX; - for (i = 0, ans = cbk; (ans != NULL) && (i < ec->fragments); - ans = ans->next) - { - data = dict_get(ans->xdata, GF_CONTENT_KEY); - if (data != NULL) - { - values[i] = ans->idx; - blocks[i] = (uint8_t *)data->data; - if (size > data->len) { - size = data->len; - } - i++; - } - } - - if (i >= ec->fragments) - { - size -= size % ec->fragment_size; - if (size > 0) - { - buff = GF_MALLOC(size * ec->fragments, gf_common_mt_char); - if (buff != NULL) - { - size = ec_method_decode(size, ec->fragments, values, - blocks, buff); - if (size > fop->size) - { - size = fop->size; - } - if (size > cbk->iatt[0].ia_size) - { - size = cbk->iatt[0].ia_size; - } - - if (dict_set_bin(cbk->xdata, GF_CONTENT_KEY, buff, - size) != 0) - { - GF_FREE(buff); - buff = NULL; - gf_log(fop->xl->name, GF_LOG_WARNING, "Lookup " - "read-ahead " - "failed"); - } - } - else - { - gf_log(fop->xl->name, GF_LOG_WARNING, "Lookup read-ahead " - "failed"); - } - } - } - - if (buff == NULL) - { - dict_del(cbk->xdata, GF_CONTENT_KEY); - } } } @@ -904,16 +840,14 @@ void ec_wind_lookup(ec_t * ec, ec_fop_data_t * fop, int32_t idx) int32_t ec_manager_lookup(ec_fop_data_t * fop, int32_t state) { - ec_cbk_data_t * cbk; + ec_cbk_data_t *cbk; switch (state) { case EC_STATE_INIT: - if (fop->xdata == NULL) - { + if (fop->xdata == NULL) { fop->xdata = dict_new(); - if (fop->xdata == NULL) - { + if (fop->xdata == NULL) { gf_log(fop->xl->name, GF_LOG_ERROR, "Unable to prepare " "lookup request"); @@ -921,21 +855,9 @@ int32_t ec_manager_lookup(ec_fop_data_t * fop, int32_t state) return EC_STATE_REPORT; } - } - else - { - uint64_t size; - - if (dict_get_uint64(fop->xdata, GF_CONTENT_KEY, &size) == 0) - { - fop->size = size; - size = ec_adjust_size(fop->xl->private, size, 1); - if (dict_set_uint64(fop->xdata, GF_CONTENT_KEY, size) != 0) - { - gf_log("ec", GF_LOG_DEBUG, "Unable to update lookup " - "content size"); - } - } + } else { + /*TODO: To be handled once we have 'syndromes' */ + dict_del (fop->xdata, GF_CONTENT_KEY); } if ((dict_set_uint64(fop->xdata, EC_XATTR_SIZE, 0) != 0) || (dict_set_uint64(fop->xdata, EC_XATTR_VERSION, 0) != 0) || |