fix oltp performance reduction(1 / 5)

This commit is contained in:
obdev 2023-02-15 13:42:35 +00:00 committed by ob-robot
parent cdb2219d06
commit 3810805e12
3 changed files with 2907 additions and 2647 deletions

View File

@ -16,6 +16,7 @@
#include "lib/stat/ob_latch_define.h"
#include "lib/allocator/ob_mod_define.h"
#include "lib/container/ob_array.h"
#include "lib/time/ob_tsc_timestamp.h"
namespace oceanbase
{
@ -118,7 +119,7 @@ public:
if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.wrlock(index_)))) {
COMMON_LOG_RET(WARN, ret_, "Fail to write lock bucket, ", K_(index), K_(ret));
} else {
lock_start_ts_ = ObTimeUtility::current_time();
lock_start_ts_ = OB_TSC_TIMESTAMP.current_time();
}
};
~ObBucketWLockGuard()
@ -127,7 +128,7 @@ public:
if (OB_UNLIKELY(OB_SUCCESS != (ret_ = lock_.unlock(index_)))) {
COMMON_LOG_RET(WARN, ret_, "Fail to unlock bucket, ", K_(index), K_(ret));
} else {
const int64_t lock_end_ts = ObTimeUtility::current_time();
const int64_t lock_end_ts = OB_TSC_TIMESTAMP.current_time();
if (lock_end_ts - lock_start_ts_ > 5 * 1000 * 1000) {
STORAGE_LOG(INFO, "bucket lock handle cost too much time",
K_(lock_start_ts),

File diff suppressed because it is too large Load Diff

View File

@ -210,7 +210,7 @@ private:
common::ObArray<share::ObLSLeaderLocation> &leaders);
private:
static const int64_t OB_LOCATION_CACHE_BUCKET_NUM = 512;
static const int64_t RENEW_LS_LOCATION_INTERVAL_US = 100 * 1000L; // 100ms
static const int64_t RENEW_LS_LOCATION_INTERVAL_US = 1000 * 1000L; // 1s
static const int64_t RENEW_LS_LOCATION_BY_RPC_INTERVAL_US = 1000 * 1000L; // 1s
static const int64_t DUMP_CACHE_INTERVAL_US = 10 * 1000 * 1000L; // 10s