提交 b990a438 编写于 作者: T TyphoonTai

modified: src/obproxy/proxy/mysql/ob_mysql_transact.cpp

上级 94c958da
...@@ -6154,7 +6154,7 @@ int ObMysqlTransact::ObTransState::get_config_item(const ObString& cluster_name, ...@@ -6154,7 +6154,7 @@ int ObMysqlTransact::ObTransState::get_config_item(const ObString& cluster_name,
} }
} }
} }
bool is_request_follower = false; bool is_request_follower = true;
if (is_weak_read_user){ if (is_weak_read_user){
is_request_follower = (RequestFollower == 1); is_request_follower = (RequestFollower == 1);
} else{ } else{
...@@ -6166,20 +6166,22 @@ int ObMysqlTransact::ObTransState::get_config_item(const ObString& cluster_name, ...@@ -6166,20 +6166,22 @@ int ObMysqlTransact::ObTransState::get_config_item(const ObString& cluster_name,
is_request_follower = (RequestFollower == int_item.get_value()); is_request_follower = (RequestFollower == int_item.get_value());
} }
} }
bool is_sys_var_update = (session_info.is_request_follower_user() != is_request_follower); if (OB_SUCC(ret)) {
session_info.set_is_request_follower_user(is_request_follower); bool is_sys_var_update = (session_info.is_request_follower_user() != is_request_follower);
if (is_sys_var_update) { session_info.set_is_request_follower_user(is_request_follower);
ObString ob_read_consistency("ob_read_consistency"); if (is_sys_var_update) {
ObString weak; ObString ob_read_consistency("ob_read_consistency");
if (session_info.is_request_follower_user()) { ObString weak;
weak = "2"; if (session_info.is_request_follower_user()) {
} else { weak = "2";
weak = "3"; } else {
} weak = "3";
if (OB_FAIL(session_info.update_sys_variable(ob_read_consistency, weak))) { }
LOG_WARN("replace user variables failed", K(weak), K(ret)); if (OB_FAIL(session_info.update_sys_variable(ob_read_consistency, weak))) {
} else { LOG_WARN("replace user variables failed", K(weak), K(ret));
session_info.set_read_consistency_set_flag(true); } else {
session_info.set_read_consistency_set_flag(true);
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册