docs/design_docs/20210604-datanode_flowgraph_recovery_design.md
update: 6.4.2021, by Goose update: 6.21.2021, by Goose
A. One message stream to one vchannel, so there are one start and one end position in one message pack.
B. Only when DataNode flushes, DataNode will update every segment's position. An optimization: update position of
C. DataNode auto-flush is a valid flush.
D. DDL messages are now in DML Vchannels.
When a flowgraph flushes a segment, we need to save these things:
Whether save successfully:
p1, p2, ... pn.Proto design for WatchDmChannelReq:
message VchannelInfo {
int64 collectionID = 1;
string channelName = 2;
msgpb.MsgPosition seek_position = 3;
repeated SegmentInfo unflushedSegments = 4;
repeated int64 flushedSegments = 5;
}
message WatchDmChannelsRequest {
common.MsgBase base = 1;
repeated VchannelInfo vchannels = 2;
}
Supposing we have segments s1, s2, s3, corresponding positions p1, p2, p3
p3, p2, p1s3 ( p3 > mp_px > p1), s2 (p2 > mp_px > p1), s1(zero)p1p1, the pseudocode:const filter_threshold = recovery_time
// mp means msgPack
for mp := seeking(p1) {
if mp.position.endtime < filter_threshold {
if mp.position < p3 {
filter s3
}
if mp.position < p2 {
filter s2
}
}
}