[CP] fix large_buffer_pool core
This commit is contained in:
parent
c63282a624
commit
ee1b331ab4
@ -75,9 +75,9 @@ char *LargeBufferPool::acquire(const int64_t size)
|
||||
char *data = NULL;
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
// try acquire from curent buffer pool with rlock
|
||||
common::ObTimeGuard time_guard("acquire", 10 * 1000L);
|
||||
WLockGuard guard(rwlock_);
|
||||
{
|
||||
RLockGuard guard(rwlock_);
|
||||
if (OB_UNLIKELY(! inited_)) {
|
||||
ret = OB_NOT_INIT;
|
||||
ARCHIVE_LOG(WARN, "large buffer pool not init", K(ret));
|
||||
@ -86,9 +86,7 @@ char *LargeBufferPool::acquire(const int64_t size)
|
||||
}
|
||||
}
|
||||
|
||||
// if not get, reserve and acquire with wlock
|
||||
if (NULL == data && OB_SUCC(ret)) {
|
||||
WLockGuard guard(rwlock_);
|
||||
if (OB_FAIL(reserve_())) {
|
||||
ARCHIVE_LOG(WARN, "reserve failed", K(ret));
|
||||
} else if (OB_FAIL(acquire_(size, data))) {
|
||||
@ -100,7 +98,8 @@ char *LargeBufferPool::acquire(const int64_t size)
|
||||
|
||||
void LargeBufferPool::reclaim(void *ptr)
|
||||
{
|
||||
RLockGuard guard(rwlock_);
|
||||
common::ObTimeGuard time_guard("reclaim", 10 * 1000L);
|
||||
WLockGuard guard(rwlock_);
|
||||
if (NULL != ptr) {
|
||||
reclaim_(ptr);
|
||||
}
|
||||
@ -112,6 +111,7 @@ void LargeBufferPool::weed_out()
|
||||
bool is_purged = false;
|
||||
const int64_t purge_threshold =
|
||||
common::ObTimeUtility::fast_current_time() - BUFFER_PURGE_THRESHOLD;
|
||||
common::ObTimeGuard time_guard("weed_out", 10 * 1000L);
|
||||
WLockGuard guard(rwlock_);
|
||||
for (int64_t i = array_.count() - 1; OB_SUCC(ret) && i >= 0; i--) {
|
||||
BufferNode &node = array_.at(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user