diff --git a/src/api/bucket.h b/src/api/bucket.h index 024e19324..a2335fef8 100644 --- a/src/api/bucket.h +++ b/src/api/bucket.h @@ -149,17 +149,12 @@ Status Bucket::PlaceBlobs(std::vector &schemas, for (size_t i = 0; i < schemas.size(); ++i) { PlacementSchema &schema = schemas[i]; - if (schema.size()) { - hermes::Blob blob = {}; - blob.data = (u8 *)blobs[i].data(); - blob.size = blobs[i].size() * sizeof(T); - // TODO(chogan): @errorhandling What about partial failure? - result = PlaceBlob(&hermes_->context_, &hermes_->rpc_, schema, blob, - names[i].c_str(), id_); - } else { - // TODO(chogan): @errorhandling - result = 1; - } + hermes::Blob blob = {}; + blob.data = (u8 *)blobs[i].data(); + blob.size = blobs[i].size() * sizeof(T); + // TODO(chogan): @errorhandling What about partial failure? + result = PlaceBlob(&hermes_->context_, &hermes_->rpc_, schema, blob, + names[i].c_str(), id_); } return result; diff --git a/src/data_placement_engine.cc b/src/data_placement_engine.cc index a3f521d1b..ea807b2ed 100644 --- a/src/data_placement_engine.cc +++ b/src/data_placement_engine.cc @@ -379,9 +379,12 @@ Status CalculatePlacement(SharedMemoryContext *context, RpcContext *rpc, } // Aggregate placement schemas from the same target - for (auto it = output_tmp.begin(); it != output_tmp.end(); ++it) { - PlacementSchema schema = AggregateBlobSchema((*it)); - output.push_back(schema); + if (!result) { + for (auto it = output_tmp.begin(); it != output_tmp.end(); ++it) { + PlacementSchema schema = AggregateBlobSchema((*it)); + CHECK(schema.size() > 0) << "PlacementSchema is empty"; + output.push_back(schema); + } } return result;