fix and enable sensitive_test

This commit is contained in:
obdev 2024-11-26 11:44:41 +00:00 committed by ob-robot
parent 7d85173367
commit 797cc6f3bc
4 changed files with 15 additions and 9 deletions

View File

@ -104,16 +104,20 @@ protected:
int64_t ref_num_;
};
class ObQSync : public ObQSyncImpl
template<int64_t MAX_REF_CNT>
class ObQSyncWrapper : public ObQSyncImpl
{
public:
enum { MAX_REF_CNT = 256 };
ObQSync() : ObQSyncImpl(local_ref_array_, MAX_REF_CNT) {}
virtual ~ObQSync() {}
ObQSyncWrapper() : ObQSyncImpl(local_ref_array_, MAX_REF_CNT) {}
virtual ~ObQSyncWrapper() {}
private:
Ref local_ref_array_[MAX_REF_CNT];
};
class ObQSync : public ObQSyncWrapper<256>
{
};
struct QSyncCriticalGuard
{
explicit QSyncCriticalGuard(ObQSync& qsync): qsync_(qsync), ref_(qsync.acquire_ref()) {}

View File

@ -18,12 +18,13 @@ namespace common
{
int ObQSyncLock::init(const lib::ObMemAttr &mem_attr)
{
return qsync_.init(mem_attr);
UNUSED(mem_attr);
return OB_SUCCESS;
}
void ObQSyncLock::destroy()
{
qsync_.destroy();
// do nothing
}
int ObQSyncLock::rdlock()

View File

@ -26,7 +26,7 @@ public:
ObQSyncLock() : write_flag_(0) {}
~ObQSyncLock() {}
int init(const lib::ObMemAttr &mem_attr);
bool is_inited() const { return qsync_.is_inited(); }
bool is_inited() const { return true; }
void destroy();
int rdlock();
void rdunlock();
@ -36,9 +36,10 @@ public:
int try_rdlock();
private:
static const int64_t TRY_SYNC_COUNT = 16;
static const int64_t MAX_REF_CNT = 48;
private:
int64_t write_flag_ CACHE_ALIGNED;
common::ObDynamicQSync qsync_;
common::ObQSyncWrapper<MAX_REF_CNT> qsync_;
};
class ObQSyncLockWriteGuard

View File

@ -186,7 +186,7 @@ private:
ObArray<ScheduleInfo> schedule_infos_;
};
const int64_t GroupIoStatusStringLength = 256;
const int64_t GroupIoStatusStringLength = 128;
const int64_t KBYTES = 1024;
const int64_t MBYTES = 1024 * KBYTES;
const int64_t GBYTES = 1024 * MBYTES;