Fix palf fs_cb dead lock bug.
This commit is contained in:
@ -29,6 +29,7 @@ namespace common
|
||||
ObTenantMutilAllocator::ObTenantMutilAllocator(uint64_t tenant_id)
|
||||
: tenant_id_(tenant_id), total_limit_(INT64_MAX), pending_replay_mutator_size_(0),
|
||||
LOG_IO_FLUSH_LOG_TASK_SIZE(sizeof(palf::LogIOFlushLogTask)),
|
||||
LOG_SLIDING_CB_TASK_SIZE(sizeof(palf::LogSlidingCbTask)),
|
||||
LOG_IO_TRUNCATE_LOG_TASK_SIZE(sizeof(palf::LogIOTruncateLogTask)),
|
||||
LOG_IO_FLUSH_META_TASK_SIZE(sizeof(palf::LogIOFlushMetaTask)),
|
||||
LOG_IO_TRUNCATE_PREFIX_BLOCKS_TASK_SIZE(sizeof(palf::LogIOTruncatePrefixBlocksTask)),
|
||||
@ -43,6 +44,7 @@ ObTenantMutilAllocator::ObTenantMutilAllocator(uint64_t tenant_id)
|
||||
inner_table_replay_task_alloc_(ObMemAttr(tenant_id, ObModIds::OB_LOG_REPLAY_ENGINE), ObVSliceAlloc::DEFAULT_BLOCK_SIZE, inner_table_replay_blk_alloc_),
|
||||
user_table_replay_task_alloc_(ObMemAttr(tenant_id, ObModIds::OB_LOG_REPLAY_ENGINE), ObVSliceAlloc::DEFAULT_BLOCK_SIZE, user_table_replay_blk_alloc_),
|
||||
log_io_flush_log_task_alloc_(LOG_IO_FLUSH_LOG_TASK_SIZE, ObMemAttr(tenant_id, "FlushLog"), choose_blk_size(LOG_IO_FLUSH_LOG_TASK_SIZE), clog_blk_alloc_, this),
|
||||
log_sliding_cb_task_alloc_(LOG_SLIDING_CB_TASK_SIZE, ObMemAttr(tenant_id, "SlidingCb"), choose_blk_size(LOG_SLIDING_CB_TASK_SIZE), clog_blk_alloc_, this),
|
||||
log_io_truncate_log_task_alloc_(LOG_IO_TRUNCATE_LOG_TASK_SIZE, ObMemAttr(tenant_id, "TruncateLog"), choose_blk_size(LOG_IO_TRUNCATE_LOG_TASK_SIZE), clog_blk_alloc_, this),
|
||||
log_io_flush_meta_task_alloc_(LOG_IO_FLUSH_META_TASK_SIZE, ObMemAttr(tenant_id, "FlushMeta"), choose_blk_size(LOG_IO_FLUSH_META_TASK_SIZE), clog_blk_alloc_, this),
|
||||
log_io_truncate_prefix_blocks_task_alloc_(LOG_IO_TRUNCATE_PREFIX_BLOCKS_TASK_SIZE, ObMemAttr(tenant_id, "FlushMeta"), choose_blk_size(LOG_IO_TRUNCATE_PREFIX_BLOCKS_TASK_SIZE), clog_blk_alloc_, this),
|
||||
@ -82,6 +84,7 @@ void ObTenantMutilAllocator::try_purge()
|
||||
inner_table_replay_task_alloc_.purge_extra_cached_block(0);
|
||||
user_table_replay_task_alloc_.purge_extra_cached_block(0);
|
||||
log_io_flush_log_task_alloc_.purge_extra_cached_block(0);
|
||||
log_sliding_cb_task_alloc_.purge_extra_cached_block(0);
|
||||
log_io_truncate_log_task_alloc_.purge_extra_cached_block(0);
|
||||
log_io_flush_meta_task_alloc_.purge_extra_cached_block(0);
|
||||
log_io_truncate_prefix_blocks_task_alloc_.purge_extra_cached_block(0);
|
||||
@ -180,6 +183,28 @@ void ObTenantMutilAllocator::free_log_io_flush_log_task(LogIOFlushLogTask *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
LogSlidingCbTask *ObTenantMutilAllocator::alloc_log_sliding_cb_task(
|
||||
const int64_t palf_id, const int64_t palf_epoch)
|
||||
{
|
||||
LogSlidingCbTask *ret_ptr = NULL;
|
||||
void *ptr = log_sliding_cb_task_alloc_.alloc();
|
||||
if (NULL != ptr) {
|
||||
ret_ptr = new(ptr)LogSlidingCbTask(palf_id, palf_epoch);
|
||||
ATOMIC_INC(&flying_sliding_cb_task_);
|
||||
}
|
||||
return ret_ptr;
|
||||
}
|
||||
|
||||
void ObTenantMutilAllocator::free_log_sliding_cb_task(LogSlidingCbTask *ptr)
|
||||
{
|
||||
if (OB_LIKELY(NULL != ptr)) {
|
||||
ptr->~LogSlidingCbTask();
|
||||
log_sliding_cb_task_alloc_.free(ptr);
|
||||
ATOMIC_DEC(&flying_sliding_cb_task_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LogIOTruncateLogTask *ObTenantMutilAllocator::alloc_log_io_truncate_log_task(
|
||||
const int64_t palf_id, const int64_t palf_epoch)
|
||||
{
|
||||
|
||||
@ -25,6 +25,7 @@ namespace oceanbase
|
||||
namespace palf
|
||||
{
|
||||
class LogIOFlushLogTask;
|
||||
class LogSlidingCbTask;
|
||||
class LogIOTruncateLogTask;
|
||||
class LogIOFlushMetaTask;
|
||||
class LogIOTruncatePrefixBlocksTask;
|
||||
@ -43,7 +44,7 @@ class ObTraceProfile;
|
||||
class ObILogAllocator : public ObIAllocator
|
||||
{
|
||||
public:
|
||||
ObILogAllocator() : flying_log_task_(0), flying_meta_task_(0) {}
|
||||
ObILogAllocator() : flying_log_task_(0), flying_meta_task_(0), flying_sliding_cb_task_(0) {}
|
||||
virtual ~ObILogAllocator() {}
|
||||
|
||||
public:
|
||||
@ -55,6 +56,8 @@ public:
|
||||
virtual const ObBlockAllocMgr &get_clog_blk_alloc_mgr() const = 0;
|
||||
virtual palf::LogIOFlushLogTask *alloc_log_io_flush_log_task(const int64_t palf_id, const int64_t palf_epoch) = 0;
|
||||
virtual void free_log_io_flush_log_task(palf::LogIOFlushLogTask *ptr) = 0;
|
||||
virtual palf::LogSlidingCbTask *alloc_log_sliding_cb_task(const int64_t palf_id, const int64_t palf_epoch) = 0;
|
||||
virtual void free_log_sliding_cb_task(palf::LogSlidingCbTask *ptr) = 0;
|
||||
virtual palf::LogIOTruncateLogTask *alloc_log_io_truncate_log_task(const int64_t palf_id, const int64_t palf_epoch) = 0;
|
||||
virtual void free_log_io_truncate_log_task(palf::LogIOTruncateLogTask *ptr) = 0;
|
||||
virtual palf::LogIOFlushMetaTask *alloc_log_io_flush_meta_task(const int64_t palf_id, const int64_t palf_epoch) = 0;
|
||||
@ -74,6 +77,7 @@ public:
|
||||
protected:
|
||||
int64_t flying_log_task_;
|
||||
int64_t flying_meta_task_;
|
||||
int64_t flying_sliding_cb_task_;
|
||||
};
|
||||
|
||||
// Interface for ReplayEngine module
|
||||
@ -137,6 +141,8 @@ public:
|
||||
// V4.0
|
||||
palf::LogIOFlushLogTask *alloc_log_io_flush_log_task(const int64_t palf_id, const int64_t palf_epoch);
|
||||
void free_log_io_flush_log_task(palf::LogIOFlushLogTask *ptr);
|
||||
palf::LogSlidingCbTask *alloc_log_sliding_cb_task(const int64_t palf_id, const int64_t palf_epoch);
|
||||
void free_log_sliding_cb_task(palf::LogSlidingCbTask *ptr);
|
||||
palf::LogIOTruncateLogTask *alloc_log_io_truncate_log_task(const int64_t palf_id, const int64_t palf_epoch);
|
||||
void free_log_io_truncate_log_task(palf::LogIOTruncateLogTask *ptr);
|
||||
palf::LogIOFlushMetaTask *alloc_log_io_flush_meta_task(const int64_t palf_id, const int64_t palf_epoch);
|
||||
@ -157,6 +163,7 @@ private:
|
||||
int64_t total_limit_;
|
||||
int64_t pending_replay_mutator_size_;
|
||||
const int LOG_IO_FLUSH_LOG_TASK_SIZE;
|
||||
const int LOG_SLIDING_CB_TASK_SIZE;
|
||||
const int LOG_IO_TRUNCATE_LOG_TASK_SIZE;
|
||||
const int LOG_IO_FLUSH_META_TASK_SIZE;
|
||||
const int LOG_IO_TRUNCATE_PREFIX_BLOCKS_TASK_SIZE;
|
||||
@ -171,6 +178,7 @@ private:
|
||||
ObVSliceAlloc inner_table_replay_task_alloc_;
|
||||
ObVSliceAlloc user_table_replay_task_alloc_;
|
||||
ObSliceAlloc log_io_flush_log_task_alloc_;
|
||||
ObSliceAlloc log_sliding_cb_task_alloc_;
|
||||
ObSliceAlloc log_io_truncate_log_task_alloc_;
|
||||
ObSliceAlloc log_io_flush_meta_task_alloc_;
|
||||
ObSliceAlloc log_io_truncate_prefix_blocks_task_alloc_;
|
||||
|
||||
Reference in New Issue
Block a user