Do not report ERROR when sample rate equals 100
This commit is contained in:
@ -1,76 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2024 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#include "storage/concurrency_control/ob_data_validation_service.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace concurrency_control
|
||||
{
|
||||
|
||||
bool ObDataValidationService::need_delay_resource_recycle(const ObLSID ls_id)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObLSService *ls_service = MTL(ObLSService*);
|
||||
ObLSHandle handle;
|
||||
ObLS *ls = nullptr;
|
||||
const bool need_delay_opt = GCONF._delay_resource_recycle_after_correctness_issue;
|
||||
bool need_delay_ret = false;
|
||||
|
||||
if (OB_UNLIKELY(!ls_id.is_valid())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
TRANS_LOG(WARN, "invalid argument", K(ret), K(ls_id));
|
||||
} else if (OB_FAIL(ls_service->get_ls(ls_id, handle, ObLSGetMod::TXSTORAGE_MOD))) {
|
||||
if (OB_LS_NOT_EXIST != ret) {
|
||||
TRANS_LOG(DEBUG, "get log stream failed", K(ls_id), K(ret));
|
||||
}
|
||||
} else if (OB_ISNULL(ls = handle.get_ls())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
TRANS_LOG(WARN, "get log stream failed", K(ls_id), K(ret));
|
||||
} else {
|
||||
need_delay_ret = ls->need_delay_resource_recycle() && need_delay_opt;
|
||||
|
||||
if (!need_delay_opt && ls->need_delay_resource_recycle()) {
|
||||
ls->clear_delay_resource_recycle();
|
||||
}
|
||||
}
|
||||
|
||||
return need_delay_ret;
|
||||
}
|
||||
|
||||
void ObDataValidationService::set_delay_resource_recycle(const ObLSID ls_id)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObLSHandle handle;
|
||||
ObLSService *ls_service = MTL(ObLSService*);
|
||||
ObLS *ls = nullptr;
|
||||
const bool need_delay_opt = GCONF._delay_resource_recycle_after_correctness_issue;
|
||||
|
||||
if (OB_LIKELY(!need_delay_opt)) {
|
||||
// do nothing
|
||||
} else if (OB_UNLIKELY(!ls_id.is_valid())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
TRANS_LOG(WARN, "invalid argument", K(ret), K(ls_id));
|
||||
} else if (OB_FAIL(ls_service->get_ls(ls_id, handle, ObLSGetMod::TXSTORAGE_MOD))) {
|
||||
if (OB_LS_NOT_EXIST != ret) {
|
||||
TRANS_LOG(DEBUG, "get log stream failed", K(ls_id), K(ret));
|
||||
}
|
||||
} else if (OB_ISNULL(ls = handle.get_ls())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
TRANS_LOG(WARN, "get log stream failed", K(ls_id), K(ret));
|
||||
} else {
|
||||
ls->set_delay_resource_recycle();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace concurrency_control
|
||||
} // namespace oceanbase
|
||||
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2024 OceanBase
|
||||
* OceanBase CE is licensed under Mulan PubL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PubL v2.
|
||||
* You may obtain a copy of Mulan PubL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPubL-2.0
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#ifndef OCEANBASE_STORAGE_CONCURRENCY_CONTROL_OB_DATA_VALIDATION_SERVICE
|
||||
#define OCEANBASE_STORAGE_CONCURRENCY_CONTROL_OB_DATA_VALIDATION_SERVICE
|
||||
|
||||
#include "storage/ls/ob_ls.h"
|
||||
#include "storage/tx_storage/ob_ls_service.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace concurrency_control
|
||||
{
|
||||
|
||||
class ObDataValidationService
|
||||
{
|
||||
public:
|
||||
static bool need_delay_resource_recycle(const ObLSID ls_id);
|
||||
static void set_delay_resource_recycle(const ObLSID ls_id);
|
||||
};
|
||||
|
||||
} // namespace concurrency_control
|
||||
} // namespace oceanbase
|
||||
|
||||
#endif // OCEANBASE_STORAGE_CONCURRENCY_CONTROL_OB_DATA_VALIDATION_SERVICE
|
||||
@ -600,7 +600,7 @@ void ObMultiVersionGarbageCollector::decide_reserved_snapshot_version_(
|
||||
K(transaction::ObWeakReadUtil::max_stale_time_for_weak_consistency(MTL_ID())));
|
||||
} else if ((global_reserved_snapshot_.get_val_for_tx() -
|
||||
reserved_snapshot.get_val_for_tx()) / 1000 > 100 * 1_min) {
|
||||
MVCC_LOG(WARN, "update a too too smaller reserved snapshot!!!", K(ret), KPC(this),
|
||||
MVCC_LOG(ERROR, "update a too too smaller reserved snapshot!!!", K(ret), KPC(this),
|
||||
K(global_reserved_snapshot_), K(reserved_snapshot));
|
||||
} else {
|
||||
MVCC_LOG(WARN, "update a too smaller reserved snapshot!", K(ret), KPC(this),
|
||||
|
||||
Reference in New Issue
Block a user