From e29c97171ce55b9584ff78ef460d9da53790c607 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 3 Apr 2023 19:11:33 +0000 Subject: [PATCH] add IS_CORNOR to transaction --- src/storage/tx/ob_trans_define.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/storage/tx/ob_trans_define.h b/src/storage/tx/ob_trans_define.h index 3cdf10d71b..bfb53ca4b3 100644 --- a/src/storage/tx/ob_trans_define.h +++ b/src/storage/tx/ob_trans_define.h @@ -1726,6 +1726,20 @@ enum class TxEndAction : int8_t KILL_TX_FORCEDLY }; +inline bool IS_CORNER_IMPL(const char *func, const int64_t line, const int64_t ppm) +{ + int ret = common::OB_SUCCESS; + bool bool_ret = false; +#ifdef ENABLE_DEBUG_LOG + bool_ret = (ObRandom::rand(0, 999999) < ppm); + TRANS_LOG(WARN, "IS_CORNER", K(func), K(line)); +#endif + UNUSED(ret); + return bool_ret; +} + +#define IS_CORNER(ppm) IS_CORNER_IMPL(__FUNCTION__, __LINE__, ppm) + } // transaction } // oceanbase