Fix tenant_id=0 of check_block()
This commit is contained in:
@ -162,7 +162,6 @@ int ObBlockManager::init(
|
||||
} else if (OB_ISNULL(io_device) || OB_UNLIKELY(block_size < ObServerSuperBlockHeader::OB_MAX_SUPER_BLOCK_SIZE)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid argument, ", K(ret), KP(io_device), K(block_size));
|
||||
} else if (FALSE_IT(timer_.set_run_wrapper(MTL_CTX()))) {
|
||||
} else if (OB_FAIL(timer_.init("BlkMgr"))) {
|
||||
LOG_WARN("fail to init timer", K(ret));
|
||||
} else if (OB_FAIL(bucket_lock_.init(DEFAULT_LOCK_BUCKET_COUNT, ObLatchIds::BLOCK_MANAGER_LOCK))) {
|
||||
@ -1414,11 +1413,6 @@ void ObBlockManager::InspectBadBlockTask::inspect_bad_block()
|
||||
std::max(GCONF._data_storage_io_timeout * 1,
|
||||
max_check_count_per_round * DEFAULT_IO_WAIT_TIME_MS * 1000);
|
||||
const int64_t begin_time = ObTimeUtility::current_time();
|
||||
#ifdef ERRSIM
|
||||
const int64_t access_time_interval = 0;
|
||||
#else
|
||||
const int64_t access_time_interval = ACCESS_TIME_INTERVAL;
|
||||
#endif
|
||||
int64_t check_count = 0;
|
||||
|
||||
for (int64_t i = 0;
|
||||
|
||||
@ -112,6 +112,15 @@ int ObMacroBlockHandle::report_bad_block() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint64_t ObMacroBlockHandle::get_tenant_id()
|
||||
{
|
||||
uint64_t tenant_id = MTL_ID();
|
||||
if (is_virtual_tenant_id(tenant_id) || 0 == tenant_id) {
|
||||
tenant_id = OB_SERVER_TENANT_ID; // use 500 tenant in io manager
|
||||
}
|
||||
return tenant_id;
|
||||
}
|
||||
|
||||
int ObMacroBlockHandle::async_read(const ObMacroBlockReadInfo &read_info)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -121,7 +130,7 @@ int ObMacroBlockHandle::async_read(const ObMacroBlockReadInfo &read_info)
|
||||
} else {
|
||||
reuse();
|
||||
ObIOInfo io_info;
|
||||
io_info.tenant_id_ = MTL_ID();
|
||||
io_info.tenant_id_ = get_tenant_id();
|
||||
io_info.offset_ = read_info.offset_;
|
||||
io_info.size_ = static_cast<int32_t>(read_info.size_);
|
||||
io_info.flag_ = read_info.io_desc_;
|
||||
@ -148,7 +157,7 @@ int ObMacroBlockHandle::async_write(const ObMacroBlockWriteInfo &write_info)
|
||||
LOG_WARN("Invalid argument", K(ret), K(write_info));
|
||||
} else {
|
||||
ObIOInfo io_info;
|
||||
io_info.tenant_id_ = MTL_ID();
|
||||
io_info.tenant_id_ = get_tenant_id();
|
||||
io_info.offset_ = write_info.offset_;
|
||||
io_info.size_ = write_info.size_;
|
||||
io_info.buf_ = write_info.buffer_;
|
||||
|
||||
@ -48,6 +48,7 @@ public:
|
||||
TO_STRING_KV(K_(macro_id), K_(io_handle));
|
||||
private:
|
||||
int report_bad_block() const;
|
||||
static uint64_t get_tenant_id();
|
||||
private:
|
||||
MacroBlockId macro_id_;
|
||||
common::ObIOHandle io_handle_;
|
||||
|
||||
Reference in New Issue
Block a user