Fix safe ts not updated#429
Conversation
|
/hold need manual test |
|
Tesed over pingcap/tiflash#10007 |
|
/unhold |
JaySon-Huang
left a comment
There was a problem hiding this comment.
IMO, some functions should return false according to the semantic
| } else { | ||
| true | ||
| } |
There was a problem hiding this comment.
ditto
tidb-engine-ext/components/raftstore/src/coprocessor/dispatcher.rs
Lines 903 to 906 in b99342a
| } else { | |
| true | |
| } | |
| } else { | |
| false | |
| } |
There was a problem hiding this comment.
/// Should be called everytime before we want to write apply state when
/// applying. Return a bool which indicates whether we can actually do
/// this write.
fn pre_write_apply_state(&self, _: &mut ObserverContext<'_>) -> bool {
true
}
The default returning value of pre_write_apply_state is true.
| } else { | ||
| true | ||
| } |
There was a problem hiding this comment.
IMO, it should return false according to the semantic
tidb-engine-ext/components/raftstore/src/coprocessor/dispatcher.rs
Lines 883 to 887 in b99342a
| } else { | |
| true | |
| } | |
| } else { | |
| false | |
| } |
There was a problem hiding this comment.
/// Should be called everytime before we write a WriteBatch into
/// KvEngine. Returns false if we can't commit at this time.
fn pre_persist(
&self,
_: &mut ObserverContext<'_>,
_is_finished: bool,
_cmd: Option<&RaftCmdRequest>,
) -> bool {
true
}
| } else { | ||
| true | ||
| } |
There was a problem hiding this comment.
ditto
tidb-engine-ext/components/raftstore/src/coprocessor/dispatcher.rs
Lines 924 to 925 in b99342a
| } else { | |
| true | |
| } | |
| } else { | |
| false | |
| } |
There was a problem hiding this comment.
pub trait RaftMessageObserver: Coprocessor {
/// Returns false if the message should not be stepped later.
fn on_raft_message(&self, _: &RaftMessage) -> bool {
true
}
}
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
ref pingcap/tiflash#10046 Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
…#10134) Note: * This change to the FFI interface for proxy adaptation. And the related issue is currently suspected to potentially cause fluctuations in LearnerRead latency in some cases. #9841, #9882 * This change to the FFI interface for proxy adaptation #9893 * Fix stale read can not eliminate the learner read #10132 ### What problem does this PR solve? Issue Number: ref #4982, close #10046 Problem Summary: update proxy to raftstore-proxy-8.1 Proxy PR: Including:\nSubmodule contrib/tiflash-proxy caa7a0c1dd..96545a2632: > Fix safe ts not updated (#429) (#434) The leader_safe_ts, self_safe_ts are always 0 in the TiFlash side, making TiFlash can not eliminate the learner read on region without any updates. ### What is changed and how it works? For detailed reasons why safe_ts failed to be updated, checkout the description on pingcap/tidb-engine-ext#429. ### Check List Tests <!-- At least one of them must be included. --> - [ ] Unit test - [ ] Integration test - [x] Manual test (add detailed scripts or steps below) - [ ] No code Side effects - [ ] Performance regression: Consumes more CPU - [ ] Performance regression: Consumes more Memory - [ ] Breaking backward compatibility Documentation - [ ] Affects user behaviors - [ ] Contains syntax changes - [ ] Contains variable changes - [ ] Contains experimental features - [ ] Changes MySQL compatibility ### Release note <!-- bugfix or new feature needs a release note --> ```release-note Fix the issue that `SELECT ... AS OF TIMESTAMP` can not eliminate the learner read on TiFlash as expected ``` --------- Signed-off-by: Calvin Neo <calvinneo1995@gmail.com> Signed-off-by: JaySon-Huang <tshent@qq.com> Signed-off-by: CalvinNeo <calvinneo1995@gmail.com> Co-authored-by: Calvin Neo <CalvinNeo@users.noreply.github.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Co-authored-by: Calvin Neo <calvinneo1995@gmail.com>

What is changed and how it works?
Issue Number: ref pingcap/tiflash#10046
The problem is that
coprocessor_hostisCopy. However, theCopytrait is derived. So different copies ofcoprocessor_hostare separated instances.So we have to move
tiflash_ob.register_toto a much earlier stage.What's Changed:
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note