Fix reinitialized max id due to unexpected 4018 from sql read
This commit is contained in:
@ -449,6 +449,7 @@ int ObMaxIdFetcher::fetch_max_id(ObISQLClient &sql_client, const uint64_t tenant
|
|||||||
ObZone zone;
|
ObZone zone;
|
||||||
const char *id_name = NULL;
|
const char *id_name = NULL;
|
||||||
const uint64_t exec_tenant_id = ObSchemaUtils::get_exec_tenant_id(tenant_id);
|
const uint64_t exec_tenant_id = ObSchemaUtils::get_exec_tenant_id(tenant_id);
|
||||||
|
bool no_max_id = false;
|
||||||
if (OB_INVALID_ID == tenant_id || !valid_max_id_type(max_id_type)) {
|
if (OB_INVALID_ID == tenant_id || !valid_max_id_type(max_id_type)) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("invalid argument", K(ret), K(tenant_id), K(max_id_type));
|
LOG_WARN("invalid argument", K(ret), K(tenant_id), K(max_id_type));
|
||||||
@ -487,13 +488,20 @@ int ObMaxIdFetcher::fetch_max_id(ObISQLClient &sql_client, const uint64_t tenant
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (OB_ITER_END == ret) {
|
if (OB_ITER_END == ret) {
|
||||||
ret = OB_ENTRY_NOT_EXIST;
|
no_max_id = true;
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN("fail to get id", "name", id_name, K(ret));
|
LOG_WARN("fail to get id", "name", id_name, K(ret));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OB_ENTRY_NOT_EXIST == ret) {
|
||||||
|
ret = OB_ERR_UNEXPECTED;
|
||||||
|
LOG_WARN("4018 not caused by no max id", K(ret));
|
||||||
|
} else if (OB_ITER_END == ret && no_max_id) {
|
||||||
|
ret = OB_ENTRY_NOT_EXIST;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user