Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class HomeObjectConan(ConanFile):
name = "homeobject"
version = "3.0.15"
version = "3.0.16"

homepage = "https://github.com/eBay/HomeObject"
description = "Blob Store built on HomeStore"
Expand Down
12 changes: 0 additions & 12 deletions src/lib/homestore_backend/gc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ void GCManager::pdev_gc_actor::start() {
// for gc
m_gc_executor = std::make_shared< folly::IOThreadPoolExecutor >(reserved_chunk_num_per_pdev -
reserved_chunk_num_per_pdev_for_egc);

m_egc_executor = std::make_shared< folly::IOThreadPoolExecutor >(reserved_chunk_num_per_pdev_for_egc);

LOGINFOMOD(gcmgr, "pdev gc actor for pdev_id={} has started", m_pdev_id);
Expand Down Expand Up @@ -345,7 +344,6 @@ folly::SemiFuture< bool > GCManager::pdev_gc_actor::add_gc_task(uint8_t priority
}

const auto pg_id = EXvchunk->m_pg_id.value();

m_hs_home_object->gc_manager()->incr_pg_pending_gc_task(pg_id);

if (!m_hs_home_object->can_chunks_in_pg_be_gc(pg_id)) {
Expand Down Expand Up @@ -666,7 +664,6 @@ bool GCManager::pdev_gc_actor::copy_valid_data(
}

auto& data_service = homestore::data_service();

const auto last_shard_id = *(shards.rbegin());
const auto& shard_info = m_hs_home_object->_get_hs_shard(last_shard_id)->info;
const auto& last_shard_state = shard_info.state;
Expand Down Expand Up @@ -985,13 +982,11 @@ bool GCManager::pdev_gc_actor::copy_valid_data(
const auto used_blks = move_to_vchunk->get_used_blks();
if (used_blks) {
homestore::MultiBlkId commit_blk_id(used_blks - 1, 1, move_to_chunk);

if (data_service.commit_blk(commit_blk_id) != homestore::BlkAllocStatus::SUCCESS) {
GCLOGE(task_id, pg_id, NO_SHARD_ID, "fail to commit_blk for move_to_chunk={}, commit_blk_id={}",
move_to_chunk, commit_blk_id.to_string());
return false;
}

GCLOGD(task_id, pg_id, NO_SHARD_ID, "successfully commit_blk in move_to_chunk={}, commit_blk_id={}",
move_to_chunk, commit_blk_id.to_string());
} else {
Expand Down Expand Up @@ -1025,11 +1020,9 @@ bool GCManager::pdev_gc_actor::copy_valid_data(
GCLOGW(task_id, pg_id, shard_id, "fail to remove tombstone, ret={}", status);
}
// TODO:: after the completion of indexsvc bug fix, we need to retry according to the returned status.

GCLOGD(task_id, pg_id, shard_id, "remove tombstone successfully, ret={}, move_from_chunk={}, move_to_chunk={}",
status, move_from_chunk, move_to_chunk);
}

GCLOGD(task_id, pg_id, NO_SHARD_ID, "data copied successfully for move_from_chunk={} to move_to_chunk={}",
move_from_chunk, move_to_chunk);

Expand Down Expand Up @@ -1070,7 +1063,6 @@ bool GCManager::pdev_gc_actor::purge_reserved_chunk(chunk_id_t chunk, const uint
}};

std::vector< std::pair< BlobRouteByChunkKey, BlobRouteValue > > valid_blob_indexes;

status = m_index_table->query(query_req, valid_blob_indexes);
if (status != homestore::btree_status_t::success) {
GCLOGE(task_id, pg_id, NO_SHARD_ID,
Expand Down Expand Up @@ -1164,10 +1156,8 @@ void GCManager::pdev_gc_actor::handle_error_before_persisting_gc_metablk(chunk_i
const auto final_state =
priority == static_cast< uint8_t >(task_priority::normal) ? ChunkState::AVAILABLE : ChunkState::INUSE;
m_chunk_selector->mark_chunk_out_of_gc_state(move_from_chunk, final_state, task_id);

task.setValue(false);
m_reserved_chunk_queue.blockingWrite(move_to_chunk);

durable_entities_update([this, priority](auto& de) {
priority == static_cast< uint8_t >(task_priority::normal) ? de.failed_gc_task_count.fetch_add(1)
: de.failed_egc_task_count.fetch_add(1);
Expand Down Expand Up @@ -1195,7 +1185,6 @@ void GCManager::pdev_gc_actor::process_gc_task(chunk_id_t move_from_chunk, uint8
RELEASE_ASSERT(vchunk->m_v_chunk_id.has_value(), "pg={}, chunk_id={} is expected to have a vchunk id, but not!",
pg_id, move_from_chunk);
const auto vchunk_id = vchunk->m_v_chunk_id.value();

chunk_id_t move_to_chunk;

// wait for a reserved chunk to be available. now, the amount of threads in the folly executor(thread pool) is equal
Expand Down Expand Up @@ -1350,7 +1339,6 @@ bool GCManager::pdev_gc_actor::process_after_gc_metablk_persisted(

m_chunk_selector->update_vchunk_info_after_gc(move_from_chunk, move_to_chunk, final_state, pg_id, vchunk_id,
task_id);

GCLOGD(
task_id, pg_id, NO_SHARD_ID,
"vchunk_id={} has been update from move_from_chunk={} to move_to_chunk={}, {} blks are reclaimed, final state "
Expand Down
6 changes: 5 additions & 1 deletion src/lib/homestore_backend/hs_homeobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,17 @@ void HSHomeObject::shutdown() {
LOGI("waiting for {} pending requests to complete", pending_reqs);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
};
LOGI("start stopping GC");
// we need stop gc before shutting down homestore(where metaservice is shutdown), because gc mgr needs metaservice
// to persist gc task metablk if there is any ongoing gc task. after stopping gc manager, there is no gc task
// anymore, and thus now new gc task will be written to metaservice during homestore shutdown.
gc_mgr_->stop();

LOGI("start shutting down HomeStore");
homestore::HomeStore::instance()->shutdown();
homestore::HomeStore::reset_instance();
gc_mgr_.reset();
iomanager.stop();

LOGI("complete shutting down HomeStore");
}

Expand Down
27 changes: 13 additions & 14 deletions src/lib/homestore_backend/replication_state_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,29 +718,28 @@ folly::Future< std::error_code > ReplicationStateMachine::on_fetch_data(const in

LOGD("fetch data with blob_id={}, shardID=0x{:x}, pg={} from index table", blob_id, shard_id, pg_id);

bool should_return_delete_marker{false};
homestore::MultiBlkId pbas;

auto rc = index_table->get(get_req);
if (sisl_unlikely(homestore::btree_status_t::success != rc)) {
// blob never exists or has been gc
LOGD("on_fetch_data failed to get from index table, blob never exists or has been gc, blob_id={}, "
"shardID=0x{:x}, pg={}",
blob_id, shard_id, pg_id);

// we return a specific blob as a delete marker if not found in index table
std::memset(given_buffer, 0, total_size);
RELEASE_ASSERT(HSHomeObject::delete_marker_blob_data.size() <= total_size,
"delete marker blob size is larger than total_size");
std::memcpy(given_buffer, HSHomeObject::delete_marker_blob_data.data(),
HSHomeObject::delete_marker_blob_data.size());

throw std::system_error(std::error_code{});
should_return_delete_marker = true;
} else {
pbas = index_value.pbas();
if (sisl_unlikely(pbas == HSHomeObject::tombstone_pbas)) {
LOGD("on_fetch_data: blob has been deleted, blob_id={}, shardID=0x{:x}, pg={}", blob_id,
shard_id, pg_id);
should_return_delete_marker = true;
}
}

const auto& pbas = index_value.pbas();
if (sisl_unlikely(pbas == HSHomeObject::tombstone_pbas)) {
LOGD("on_fetch_data: blob has been deleted, blob_id={}, shardID=0x{:x}, pg={}", blob_id, shard_id,
if (should_return_delete_marker) {
LOGD("on_fetch_data: return delete marker for blob_id={}, shardID=0x{:x}, pg={}", blob_id, shard_id,
pg_id);

// we return a specific blob as a delete marker for tombstone pbas
std::memset(given_buffer, 0, total_size);
RELEASE_ASSERT(HSHomeObject::delete_marker_blob_data.size() <= total_size,
"delete marker blob size is larger than total_size");
Expand Down