pingcap / pingcap/tidb

memory sync consistency across tidb node(stats/bindings/... for example)

Open
#56,741 1 comment 0 reactions 0 assignees View on GitHub
affects-7.5 affects-8.1 report/customer sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
for delta stats updates across tidb nodes, the multi writes acorss tidb nodes will finally be converted sequential apply-logs at the stats_meta table via group leader role. so the data consistency is gained in a dependent storage layer, while tidb in-mem stats cache should be notified when the new commits are applied in case of loss of stats renew.As is known to all, tikv component did a great job on consistency guarantee based on raft mechanism, the multi writes at different tikv node will form leader‘s sequential apply-logs and delivered across the raft group members (number basically equal to 3). the consistency can be guaranteed across the group members when one of them is being request because of the apply log is on the same node already.

for delta stats updates across tidb nodes, the multi writes acorss tidb nodes will finally be converted sequential apply-logs at the stats_meta table via group leader role. so the data consistency is gained in a dependent storage layer, while tidb in-mem stats cache should be notified when the new commits are applied in case of loss of stats renew. So we have the cache consistency problem by now.

we don't need to consider a complete [cache coherence](https://link.zhihu.com/?target=https%3A//en.wikipedia.org/wiki/Cache_coherence) problem, because the write propagation and transaction serialization have already been guaranteed in storage layer, what we need here is to design a appropriate subscribed or notifying mechanism to make sure all tidb nodes can get them all instantly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.