summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-05-28 15:33:18 +0530
committerXavier Hernandez <xhernandez@datalab.es>2015-07-21 04:53:20 -0700
commit5563a9bbbe6a901e3a7255f090360809ca83ac9d (patch)
tree6d1e669ef5ea9132bc82ddf1494beb9533da6e8b /xlators
parentcb8f419fd8e36b6eb5a48db5694e475cb79553c9 (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> BUG: 1243642 Change-Id: I490e33a7cec64ce4c2670c6f17c93e5ce9576b14 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/11678 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-generic.c92
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 45b65c9c025..6ffdbcf01d1 100644
--- a/xlators/cluster/ec/src/ec-generic.c
+++ b/xlators/cluster/ec/src/ec-generic.c
@@ -712,12 +712,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)
{
@@ -753,73 +750,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);
- }
}
}
@@ -921,16 +857,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_msg (fop->xl->name, GF_LOG_ERROR, EIO,
EC_MSG_LOOKUP_REQ_PREP_FAIL, "Unable to prepare "
"lookup request");
@@ -939,21 +873,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) ||