fix tenant_role user primary as default
This commit is contained in:
@ -1352,9 +1352,9 @@ int ObTableLocation::get_is_weak_read(const ObDMLStmt &dml_stmt,
|
||||
dml_stmt.get_query_ctx()->is_contain_select_for_update_ ||
|
||||
dml_stmt.get_query_ctx()->is_contain_inner_table_) {
|
||||
is_weak_read = false;
|
||||
} else if (share::ObTenantEnv::get_tenant() == nullptr) { //table api can't invoke MTL_IS_PRIMARY_TENANT
|
||||
} else if (share::ObTenantEnv::get_tenant() == nullptr) { //table api can't invoke MTL_TENANT_ROLE_CACHE_IS_PRIMARY_OR_INVALID
|
||||
is_weak_read = false;
|
||||
} else if (!MTL_IS_PRIMARY_TENANT()) {
|
||||
} else if (!MTL_TENANT_ROLE_CACHE_IS_PRIMARY_OR_INVALID()) {
|
||||
is_weak_read = true;
|
||||
} else {
|
||||
ObConsistencyLevel consistency_level = INVALID_CONSISTENCY;
|
||||
|
||||
@ -1163,7 +1163,7 @@ int ObResolver::resolve(IsPrepared if_prepared, const ParseNode &parse_tree, ObS
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
if (ObStmt::is_write_stmt(stmt->get_stmt_type(), stmt->has_global_variable())
|
||||
&& !MTL_IS_PRIMARY_TENANT()) {
|
||||
&& !MTL_TENANT_ROLE_CACHE_IS_PRIMARY_OR_INVALID()) {
|
||||
ret = OB_STANDBY_READ_ONLY;
|
||||
TRANS_LOG(WARN, "standby tenant support read only", K(ret), K(stmt));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user