BUGFIX: write throttle sleep as expected after freeze

This commit is contained in:
obdev
2023-10-17 07:39:32 +00:00
committed by ob-robot
parent 5eb3fc598a
commit 73aa6149cf
5 changed files with 36 additions and 0 deletions

View File

@ -47,6 +47,7 @@ ObStorageTableGuard::ObStorageTableGuard(
for_multi_source_data_(for_multi_source_data)
{
init_ts_ = ObTimeUtility::current_time();
get_thread_alloc_stat() = 0;
}
ObStorageTableGuard::~ObStorageTableGuard()
@ -122,6 +123,11 @@ ObStorageTableGuard::~ObStorageTableGuard()
has_sleep = true;
need_sleep = memstore_allocator->need_do_writing_throttle();
}
const int64_t finish_clock = memstore_allocator->get_clock();
if (finish_clock < seq) { // we has skip some time, need make the clock skip too.
const int64_t skip_clock = MIN(seq - finish_clock, get_thread_alloc_stat());
memstore_allocator->skip_clock(skip_clock);
}
}
if (REACH_TIME_INTERVAL(100 * 1000L) &&