add wait event to ObGarbageCollector

This commit is contained in:
HaHaJeff
2024-04-26 11:20:27 +00:00
committed by ob-robot
parent 30748ceed7
commit 6bdeecb4d0
2 changed files with 3 additions and 1 deletions

View File

@ -125,6 +125,7 @@ WAIT_EVENT_DEF(STORAGE_WRITING_THROTTLE_SLEEP, 20003, "sleep: storage writing th
WAIT_EVENT_DEF(STORAGE_AUTOINC_FETCH_RETRY_SLEEP, 20004, "sleep: tablet autoinc fetch new range retry wait", "sleep_interval", "", "", CONCURRENCY, true, true) WAIT_EVENT_DEF(STORAGE_AUTOINC_FETCH_RETRY_SLEEP, 20004, "sleep: tablet autoinc fetch new range retry wait", "sleep_interval", "", "", CONCURRENCY, true, true)
WAIT_EVENT_DEF(STORAGE_AUTOINC_FETCH_CONFLICT_SLEEP, 20005, "sleep: tablet autoinc fetch new range conflict wait", "sleep_interval", "", "", CONCURRENCY, true, true) WAIT_EVENT_DEF(STORAGE_AUTOINC_FETCH_CONFLICT_SLEEP, 20005, "sleep: tablet autoinc fetch new range conflict wait", "sleep_interval", "", "", CONCURRENCY, true, true)
WAIT_EVENT_DEF(STORAGE_HA_FINISH_TRANSFER, 20006, "sleep: finish transfer sleep wait", "sleep_interval", "", "", CONCURRENCY, true, true) WAIT_EVENT_DEF(STORAGE_HA_FINISH_TRANSFER, 20006, "sleep: finish transfer sleep wait", "sleep_interval", "", "", CONCURRENCY, true, true)
WAIT_EVENT_DEF(GARBAGE_COLLECTOR_SLEEP, 20007, "sleep: wait log callback sleep wait", "sleep_interval", "", "", CONCURRENCY, true, true)
// logservice // logservice

View File

@ -36,6 +36,7 @@
#include "share/ob_occam_time_guard.h" #include "share/ob_occam_time_guard.h"
#include "storage/slog_ckpt/ob_server_checkpoint_slog_handler.h" #include "storage/slog_ckpt/ob_server_checkpoint_slog_handler.h"
#include "storage/concurrency_control/ob_data_validation_service.h" #include "storage/concurrency_control/ob_data_validation_service.h"
#include "lib/wait_event/ob_wait_event.h"
namespace oceanbase namespace oceanbase
{ {
@ -1042,7 +1043,7 @@ int ObGCHandler::submit_log_(const ObGCLSLOGType log_type, bool &is_success)
} }
if (!is_finished) { if (!is_finished) {
ob_usleep(WAIT_TIME); ob_usleep<ObWaitEventIds::GARBAGE_COLLECTOR_SLEEP>(WAIT_TIME);
if (REACH_TIME_INTERVAL(2 * 1000 * 1000L)) { if (REACH_TIME_INTERVAL(2 * 1000 * 1000L)) {
CLOG_LOG_RET(WARN, OB_ERR_TOO_MUCH_TIME, "GC ls log wait cb too much time", CLOG_LOG_RET(WARN, OB_ERR_TOO_MUCH_TIME, "GC ls log wait cb too much time",
K(wait_for_update_ls_gc_state), K(log_type), K(ls_id), K(scn)); K(wait_for_update_ls_gc_state), K(log_type), K(ls_id), K(scn));