fix upgrade error && open adaptive_merge_schedule

This commit is contained in:
Fengjingkun
2023-12-18 22:13:08 +00:00
committed by ob-robot
parent fade38c7d2
commit d2ef3db981
19 changed files with 146 additions and 111 deletions

View File

@ -301,8 +301,8 @@ int ObTenantCompactionMemPool::init()
chunk_allocator_.set_tenant_id(MTL_ID());
piece_allocator_.set_tenant_id(MTL_ID());
max_block_num_ = MTL_IS_MINI_MODE()
? MAX_MEMORY_LIMIT / ObCompactionBufferChunk::DEFAULT_BLOCK_SIZE
: MAX_MEMORY_LIMIT / (ObCompactionBufferChunk::DEFAULT_BLOCK_SIZE * 2);
? MINI_MODE_CHUNK_MEMORY_LIMIT / ObCompactionBufferChunk::DEFAULT_BLOCK_SIZE
: CHUNK_MEMORY_LIMIT / ObCompactionBufferChunk::DEFAULT_BLOCK_SIZE;
total_block_num_ = 0;
is_inited_ = true;
}
@ -493,8 +493,8 @@ int ObTenantCompactionMemPool::try_shrink()
{
int ret = OB_SUCCESS;
ObSpinLockGuard guard(chunk_lock_);
if (max_block_num_ > total_block_num_) {
// not reserve mem in mini mode
if (!MTL_IS_MINI_MODE() && max_block_num_ > total_block_num_) {
// do nothing
} else if (used_block_num_ <= total_block_num_ / 2) {
// Less than half of blocks were used, need shrink
@ -544,7 +544,9 @@ void ObTenantCompactionMemPool::MemPoolShrinkTask::runTimerTask()
bool ObTenantCompactionMemPool::acquire_reserve_mem()
{
bool bret = false;
bret = ATOMIC_BCAS(&reserve_mode_signal_, 1, 0);
if (!MTL_IS_MINI_MODE()) {
bret = ATOMIC_BCAS(&reserve_mode_signal_, 1, 0);
}
return bret;
}