Skip to content

Commit

Permalink
Accumulative fix for v2 compat (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
CalvinNeo authored May 19, 2023
1 parent 5cdf477 commit 6a1d0f7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 11 additions & 0 deletions proxy_components/engine_store_ffi/src/core/forward_raft/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ impl<T: Transport + 'static, ER: RaftEngine> ProxyForwarder<T, ER> {
fail::fail_point!("on_empty_cmd_normal", |_| {});
debug!("encounter empty cmd, maybe due to leadership change";
"region" => ?ob_region,
"region_id" => region_id,
"index" => index,
"term" => term,
);
Expand All @@ -262,7 +263,17 @@ impl<T: Transport + 'static, ER: RaftEngine> ProxyForwarder<T, ER> {
let response = &cmd.response;
if response.get_header().has_error() {
let proto_err = response.get_header().get_error();
let mut ignorable_error = false;
if proto_err.has_flashback_in_progress() {
ignorable_error = true;
}
if cmd.request.has_admin_request()
&& cmd.request.get_admin_request().get_cmd_type() == AdminCmdType::UpdateGcPeer
{
// We are safe to treaat v2's admin cmd as an empty cmd.
ignorable_error = true;
}
if ignorable_error {
debug!(
"error occurs when apply_write_cmd, {:?}",
response.get_header().get_error()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ impl<T: Transport + 'static, ER: RaftEngine> ProxyForwarder<T, ER> {
let f = |info: MapEntry<u64, Arc<CachedRegionInfo>>| match info {
MapEntry::Occupied(mut o) => {
// Note the region info may be registered by maybe_fast_path_tick
info!("{} {}:{} {}, peer created",
if is_fap_enabled {"fast path: ongoing"} else {""},
info!("{}{}:{} {}, peer created again",
if is_fap_enabled {"fast path: ongoing "} else {" "},
self.store_id, region_id, 0;
"region_id" => region_id,
"leader_id" => r.leader_id,
"role" => ?r.state,
"is_replicated" => is_replicated,
);
if is_replicated {
Expand All @@ -98,10 +100,12 @@ impl<T: Transport + 'static, ER: RaftEngine> ProxyForwarder<T, ER> {
}
}
MapEntry::Vacant(v) => {
info!("{} {}:{} {}, peer created",
if is_fap_enabled {"fast path: ongoing"} else {""},
info!("{}{}:{} {}, peer created",
if is_fap_enabled {"fast path: ongoing "} else {" "},
self.store_id, region_id, r.peer_id;
"region_id" => region_id,
"leader_id" => r.leader_id,
"role" => ?r.state,
"is_replicated" => is_replicated,
);
if is_replicated {
Expand Down

0 comments on commit 6a1d0f7

Please sign in to comment.