Skip to content

Commit

Permalink
Merge pull request #9407: hammer: RGW :: Subset of uploaded objects v…
Browse files Browse the repository at this point in the history
…ia radosgw are unretrievable when using erasure coded pool

Reviewed-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Jun 27, 2016
2 parents 0817777 + 4eea92b commit 7880209
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/rgw/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1189,19 +1189,34 @@ int RGWPutObjProcessor_Atomic::complete_writing_data()
first_chunk.claim(pending_data_bl);
obj_len = (uint64_t)first_chunk.length();
}
if (pending_data_bl.length()) {
while (pending_data_bl.length()) {
void *handle;
uint64_t max_write_size = MIN(max_chunk_size, (uint64_t)next_part_ofs - data_ofs);
if (max_write_size > pending_data_bl.length()) {
max_write_size = pending_data_bl.length();
}
bufferlist bl;
pending_data_bl.splice(0, max_write_size, &bl);
rgw_obj obj;
int r = write_data(pending_data_bl, data_ofs, &handle, &obj, false);
int r = write_data(bl, data_ofs, &handle, &obj, false);
if (r < 0) {
ldout(store->ctx(), 0) << "ERROR: write_data() returned " << r << dendl;
return r;
}
data_ofs += bl.length();
r = throttle_data(handle, obj, false);
if (r < 0) {
ldout(store->ctx(), 0) << "ERROR: throttle_data() returned " << r << dendl;
return r;
}

if (data_ofs >= next_part_ofs) {
r = prepare_next_part(data_ofs);
if (r < 0) {
ldout(store->ctx(), 0) << "ERROR: prepare_next_part() returned " << r << dendl;
return r;
}
}
}
int r = complete_parts();
if (r < 0) {
Expand Down Expand Up @@ -1410,6 +1425,10 @@ int RGWRados::get_required_alignment(rgw_bucket& bucket, uint64_t *alignment)
}

*alignment = ioctx.pool_required_alignment();
if (*alignment != 0) {
ldout(cct, 20) << "required alignment=" << *alignment << dendl;
}

return 0;
}

Expand All @@ -1435,6 +1454,8 @@ int RGWRados::get_max_chunk_size(rgw_bucket& bucket, uint64_t *max_chunk_size)

*max_chunk_size = config_chunk_size - (config_chunk_size % alignment);

ldout(cct, 20) << "max_chunk_size=" << *max_chunk_size << dendl;

return 0;
}

Expand Down

0 comments on commit 7880209

Please sign in to comment.