change the create_tablet batch size to 1M

This commit is contained in:
obdev
2023-07-25 07:42:43 +00:00
committed by ob-robot
parent 7a79c94c1c
commit e4ac16a787
2 changed files with 7 additions and 2 deletions

View File

@ -269,7 +269,8 @@ int ObTabletCreator::add_create_tablet_arg(const ObTabletCreatorArg &arg)
}
if (OB_FAIL(ret)) {
} else if (batch_arg->arg_.get_serialize_size() > transaction::ObTxMultiDataSourceLog::MAX_MDS_LOG_SIZE) {
} else if (batch_arg->arg_.get_serialize_size() > BATCH_ARG_SIZE) {
LOG_INFO("batch arg is more than 1M", KR(ret), K(batch_arg->arg_.tablets_.count()), K(batch_arg->arg_));
void *arg_buf = allocator_.alloc(sizeof(ObBatchCreateTabletHelper));
ObBatchCreateTabletHelper *new_arg = NULL;
if (OB_ISNULL(arg_buf)) {
@ -318,7 +319,6 @@ int ObTabletCreator::execute()
LOG_WARN("batch arg not be null", KR(ret));
} else {
while (OB_SUCC(ret) && OB_NOT_NULL(batch_arg)) {
LOG_INFO("generate create arg", KPC(batch_arg), K(lbt()));
int64_t buf_len = batch_arg->arg_.get_serialize_size();
int64_t pos = 0;
char *buf = (char*)allocator_.alloc(buf_len);
@ -331,6 +331,7 @@ int ObTabletCreator::execute()
LOG_WARN("fail to set timeout ctx", KR(ret), K(default_timeout_ts));
} else {
do {
LOG_INFO("generate create arg", K(buf_len), K(batch_arg->arg_.tablets_.count()), K(batch_arg->arg_));
if (ctx.is_timeouted()) {
ret = OB_TIMEOUT;
LOG_WARN("already timeout", KR(ret), K(ctx));

View File

@ -95,6 +95,10 @@ private:
class ObTabletCreator
{
public:
// 1. BATCH_ARG_SIZE cannot be too large to cause get_serialize_size to take too long
// 2. BATCH_ARG_SIZE cannot be more than multi-trans buffer limit (1.5M)
const static int64_t BATCH_ARG_SIZE = 1024 * 1024; // 1M
ObTabletCreator(
const uint64_t tenant_id,
const share::SCN &major_frozen_scn,