@@ -25,14 +25,14 @@ SISL_LOGGING_DECL(gcmgr)
2525GCManager::GCManager (HSHomeObject* homeobject) :
2626 m_chunk_selector{homeobject->chunk_selector ()}, m_hs_home_object{homeobject} {
2727 homestore::meta_service ().register_handler (
28- _gc_actor_meta_name ,
28+ gc_actor_meta_name ,
2929 [this ](homestore::meta_blk* mblk, sisl::byte_view buf, size_t size) {
3030 on_gc_actor_meta_blk_found (std::move (buf), voidptr_cast (mblk));
3131 },
3232 nullptr , true );
3333
3434 homestore::meta_service ().register_handler (
35- _gc_reserved_chunk_meta_name ,
35+ gc_reserved_chunk_meta_name ,
3636 [this ](homestore::meta_blk* mblk, sisl::byte_view buf, size_t size) {
3737 on_reserved_chunk_meta_blk_found (std::move (buf), voidptr_cast (mblk));
3838 },
@@ -44,7 +44,7 @@ GCManager::GCManager(HSHomeObject* homeobject) :
4444 true );
4545
4646 homestore::meta_service ().register_handler (
47- _gc_task_meta_name ,
47+ gc_task_meta_name ,
4848 [this ](homestore::meta_blk* mblk, sisl::byte_view buf, size_t size) {
4949 on_gc_task_meta_blk_found (std::move (buf), voidptr_cast (mblk));
5050 },
@@ -64,7 +64,7 @@ void GCManager::on_gc_task_meta_blk_found(sisl::byte_view const& buf, void* meta
6464 // here, we are under the protection of the lock of metaservice. however, we will also try to update pg and shard
6565 // metablk and then destroy the gc_task_sb, which will also try to acquire the lock of metaservice, as a result, a
6666 // dead lock will happen. so here we will handle all the gc tasks after read all the metablks
67- m_recovered_gc_tasks.emplace_back (_gc_task_meta_name );
67+ m_recovered_gc_tasks.emplace_back (gc_task_meta_name );
6868 m_recovered_gc_tasks.back ().load (buf, meta_cookie);
6969}
7070
@@ -89,7 +89,7 @@ void GCManager::handle_all_recovered_gc_tasks() {
8989}
9090
9191void GCManager::on_gc_actor_meta_blk_found (sisl::byte_view const & buf, void * meta_cookie) {
92- m_gc_actor_sbs.emplace_back (_gc_actor_meta_name );
92+ m_gc_actor_sbs.emplace_back (gc_actor_meta_name );
9393 auto & gc_actor_sb = m_gc_actor_sbs.back ();
9494 gc_actor_sb.load (buf, meta_cookie);
9595 auto pdev_id = gc_actor_sb->pdev_id ;
@@ -100,7 +100,7 @@ void GCManager::on_gc_actor_meta_blk_found(sisl::byte_view const& buf, void* met
100100}
101101
102102void GCManager::on_reserved_chunk_meta_blk_found (sisl::byte_view const & buf, void * meta_cookie) {
103- homestore::superblk< gc_reserved_chunk_superblk > reserved_chunk_sb (_gc_reserved_chunk_meta_name );
103+ homestore::superblk< gc_reserved_chunk_superblk > reserved_chunk_sb (gc_reserved_chunk_meta_name );
104104 auto chunk_id = reserved_chunk_sb.load (buf, meta_cookie)->chunk_id ;
105105 auto EXVchunk = m_chunk_selector->get_extend_vchunk (chunk_id);
106106 if (EXVchunk == nullptr ) {
@@ -520,7 +520,7 @@ bool GCManager::pdev_gc_actor::get_blobs_to_replace(
520520
521521 auto ret = m_index_table->query (query_req, valid_blob_indexes);
522522 if (ret != homestore::btree_status_t ::success) {
523- // "ret != homestore::btree_status_t::has_more" is not expetced here, since we are querying all the pbas in one
523+ // "ret != homestore::btree_status_t::has_more" is not expected here, since we are querying all the pbas in one
524524 // time.
525525 GCLOGE (task_id, pg_id, NO_SHARD_ID ,
526526 " Failed to query blobs in gc index table for move_to_chunk={}, index ret={}" , move_to_chunk, ret);
@@ -976,13 +976,14 @@ bool GCManager::pdev_gc_actor::copy_valid_data(
976976
977977 if (err) {
978978 // we will come here if:
979- // 1 any blob copy fails, then err is operation_canceled
979+ // 1 any blob copy fails, then err is operation_cancelled
980980 // 2 write footer fails, then err is the error code of write footer
981- GCLOGE (task_id, pg_id, shard_id,
982- " Failed to copy some blos or failed to write shard footer for move_to_chunk={}, "
983- " err={}, error_category={}, error_message={}, pls check the log for more "
984- " detailed info" ,
985- move_to_chunk, err.value (), err.category ().name (), err.message ());
981+ GCLOGE (
982+ task_id, pg_id, shard_id,
983+ " Failed to copy some blobs or failed to write shard footer for move_to_chunk={}, "
984+ " err={}, error_category={}, error_message={}, pls check the log for more "
985+ " detailed info" ,
986+ move_to_chunk, err.value (), err.category ().name (), err.message ());
986987 return false ;
987988 }
988989 return true ;
@@ -1266,12 +1267,16 @@ void GCManager::pdev_gc_actor::process_gc_task(chunk_id_t move_from_chunk, uint8
12661267
12671268 // trigger cp to make sure the offset the the append blk allocator and the wbcache of gc index table are both
12681269 // flushed.
1269- auto fut = homestore::hs ()->cp_mgr ().trigger_cp_flush (true /* force */ );
1270- RELEASE_ASSERT (std::move (fut).get (), " expect gc index table and blk allocator to be flushed but failed!" );
1270+ if (!homestore::hs ()->cp_mgr ().trigger_cp_flush (true /* force */ ).get ()) {
1271+ GCLOGW (task_id, pg_id, NO_SHARD_ID , " expect gc index table and blk allocator to be flushed but failed!" );
1272+ handle_error_before_persisting_gc_metablk (move_from_chunk, move_to_chunk, std::move (task), task_id, priority,
1273+ pg_id);
1274+ return ;
1275+ }
12711276
12721277 // after data copy, we persist the gc task meta blk. now, we can make sure all the valid blobs are successfully
1273- // copyed and new blob indexes have be written to gc index table before gc task superblk is persisted.
1274- homestore::superblk< GCManager::gc_task_superblk > gc_task_sb{GCManager::_gc_task_meta_name };
1278+ // copied and new blob indexes have been written to gc index table before gc task superblk is persisted.
1279+ homestore::superblk< GCManager::gc_task_superblk > gc_task_sb{GCManager::gc_task_meta_name };
12751280 gc_task_sb.create (sizeof (GCManager::gc_task_superblk));
12761281 gc_task_sb->move_from_chunk = move_from_chunk;
12771282 gc_task_sb->move_to_chunk = move_to_chunk;
0 commit comments