OpenAtomFoundation / pikiwidb

a high-performance, large-capacity, multi-tenant, data-persistent, strong data consistency based on raft, Redis-compatible elastic KV data storage system based on RocksDB
BSD 3-Clause "New" or "Revised" License
194 stars 63 forks source link

feat: return redirect message when received a write command in raft mode #302

Closed longfar-ncy closed 3 months ago

longfar-ncy commented 3 months ago

在RAFT模式下,当 follower 节点收到写命令时,应当返回重定向到leader的信息

chanfun-ren commented 3 months ago
  1. 这里读命令不需要转发至 leader 吗?要不然会出现过期读的情况吧;
  2. 我看目前去掉了 PingCmd 的 write flag, CmdConfigGet 和 ShutdownCmd 是不是也得去掉 write flag;
Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


  1. Doesn’t the read command here need to be forwarded to the leader? Otherwise, overdue reading may occur;
  2. I think the write flag of PingCmd has been removed. Do CmdConfigGet and ShutdownCmd also need to remove the write flag?