[
https://issues.apache.org/jira/browse/IOTDB-6227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785717#comment-17785717
]
Song Ziyang commented on IOTDB-6227:
------------------------------------
该问题产生的原因:Ratis在leader切换期间默认不允许读取数据,因此所有的read请求将会{*}立马fail。{*}
该问题解决的方案:IoTDB侧在leader切换期间的所有read请求会重试,直到leader选出来正常返回read的结果。
该问题测试验证的方法:
# 验证原来的问题存在:启动集群,正常读写一段时间后,找到一个schema
region的leader,将其强制下线,之后马上读取这个region其他任意节点的元数据,将会收到Raft Server is redoing Raft
Log的报错。
# 验证现在问题已经解决了:同样是上述操作,强制下线leader之后读取其他节点的数据,这次在等待一段时间之后(4-8s
leader完成选举)将会读到需要的数据。
> Made Ratis linearizable read retriable
> --------------------------------------
>
> Key: IOTDB-6227
> URL: https://issues.apache.org/jira/browse/IOTDB-6227
> Project: Apache IoTDB
> Issue Type: Improvement
> Reporter: Song Ziyang
> Assignee: Song Ziyang
> Priority: Major
> Labels: pull-request-available
> Attachments: image-2023-11-13-15-19-24-989.png,
> image-2023-11-13-15-20-21-579.png
>
>
> Currently if the cluster leader is not elected, the linearizable read will
> return failure immediately. We should retry on that condition.
>
> !image-2023-11-13-15-20-21-579.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)