redis sink worklog
10 Dec 2023
|
|
没实现的思路,中道崩卒了
sinkcommand
sinkto ip port
replicationSetSink
if slave do getlog
if already sink close sink clear sink log check LSN 断点续传判定? curLSN, SinkLSN if curLSN = -1 没同步过,整体扫 if curLSN < SinkLSN, drop SinkLSN 是logcenter给的,不可能大于 assert(curLSN > SinkLSN)
key object信息带上LSN -1 就-1 int64够用
scanWithLSN -> log buffer if log buffer full wait
log buffer -> servercon -> sink log
意外重启可能导致不幂等, 除非子key也有LSN,回滚能检测到
意外重启丢了就丢了
更新一半断了
AOF normal AOF delta
更新一半断了,
logcenter要求死循环无限重试