@@ -88,7 +88,7 @@ BlobManager::AsyncResult< blob_id_t > HSHomeObject::_put_blob(ShardInfo const& s
8888 return folly::makeUnexpected (BlobErrorCode::SHUTTING_DOWN );
8989 }
9090 incr_pending_request_num ();
91- // check user key size
91+ // check user key size
9292 if (blob.user_key .size () > BlobHeader::max_user_key_length) {
9393 BLOGE (tid, shard.id , 0 , " input user key length > max_user_key_length {}" , blob.user_key .size (),
9494 BlobHeader::max_user_key_length);
@@ -167,8 +167,7 @@ BlobManager::AsyncResult< blob_id_t > HSHomeObject::_put_blob(ShardInfo const& s
167167
168168 // Set offset of actual data after the blob header and user key (rounded off)
169169 req->blob_header ()->data_offset = req->blob_header_buf ().size ();
170- RELEASE_ASSERT (req->blob_header ()->data_offset == _data_block_size,
171- " blob header should equals _data_block_size" );
170+ RELEASE_ASSERT (req->blob_header ()->data_offset == _data_block_size, " blob header should equals _data_block_size" );
172171 // In case blob body is not aligned, create a new aligned buffer and copy the blob body.
173172 if (((r_cast< uintptr_t >(blob.body .cbytes ()) % io_align) != 0 ) || ((blob_size % io_align) != 0 )) {
174173 // If address or size is not aligned, create a separate aligned buffer and do expensive memcpy.
@@ -367,9 +366,7 @@ BlobManager::AsyncResult< Blob > HSHomeObject::_get_blob_data(const shared< home
367366 }
368367
369368 auto verify_result = do_verify_blob (read_buf.cbytes (), shard_id, 0 /* no blob_id check */ );
370- if (!verify_result.hasValue ()) {
371- return folly::makeUnexpected (verify_result.error ());
372- }
369+ if (!verify_result.hasValue ()) { return folly::makeUnexpected (verify_result.error ()); }
373370 std::string user_key = std::move (verify_result.value ());
374371
375372 BlobHeader const * header = r_cast< BlobHeader const * >(read_buf.cbytes ());
@@ -498,8 +495,14 @@ HSHomeObject::blob_put_get_blk_alloc_hints(sisl::blob const& header, cintrusive<
498495 hs_shard->sb_ ->p_chunk_id , get_reserved_blks ());
499496
500497 if (msg_header->blob_id != 0 ) {
498+ auto pg_index_table = hs_pg->index_table_ ;
499+ if (!pg_index_table) {
500+ LOGW (" index table is not found for pg={}, skip statistics refresh" , msg_header->pg_id );
501+ return folly::makeUnexpected (homestore::ReplServiceError::RESULT_NOT_EXIST_YET );
502+ }
503+
501504 // check if the blob already exists, if yes, return the blk id
502- auto r = get_blob_from_index_table (hs_pg-> index_table_ , msg_header->shard_id , msg_header->blob_id );
505+ auto r = get_blob_from_index_table (pg_index_table , msg_header->shard_id , msg_header->blob_id );
503506 if (r.hasValue ()) {
504507 BLOGT (tid, msg_header->shard_id , msg_header->blob_id ,
505508 " Blob has already been persisted, blk_num={}, blk_count={}" , r.value ().blk_num (),
0 commit comments