refactor(sync): add pre snapshot
This commit is contained in:
parent
f7191d2ffd
commit
3072afbacb
|
@ -39,6 +39,7 @@ extern bool gRaftDetailLog;
|
||||||
#define SYNC_ADD_QUORUM_COUNT 3
|
#define SYNC_ADD_QUORUM_COUNT 3
|
||||||
#define SYNC_MNODE_LOG_RETENTION 10000
|
#define SYNC_MNODE_LOG_RETENTION 10000
|
||||||
#define SYNC_VNODE_LOG_RETENTION 100
|
#define SYNC_VNODE_LOG_RETENTION 100
|
||||||
|
#define SNAPSHOT_MAX_CLOCK_SKEW_MS 1000 * 10
|
||||||
|
|
||||||
#define SYNC_APPEND_ENTRIES_TIMEOUT_MS 10000
|
#define SYNC_APPEND_ENTRIES_TIMEOUT_MS 10000
|
||||||
|
|
||||||
|
|
|
@ -617,7 +617,7 @@ typedef struct SyncSnapshotSend {
|
||||||
SyncTerm lastTerm; // snapshot.lastTerm
|
SyncTerm lastTerm; // snapshot.lastTerm
|
||||||
SyncIndex lastConfigIndex; // snapshot.lastConfigIndex
|
SyncIndex lastConfigIndex; // snapshot.lastConfigIndex
|
||||||
SSyncCfg lastConfig;
|
SSyncCfg lastConfig;
|
||||||
SyncTerm privateTerm;
|
int64_t startTime;
|
||||||
int32_t seq;
|
int32_t seq;
|
||||||
uint32_t dataLen;
|
uint32_t dataLen;
|
||||||
char data[];
|
char data[];
|
||||||
|
@ -652,9 +652,10 @@ typedef struct SyncSnapshotRsp {
|
||||||
SyncTerm term;
|
SyncTerm term;
|
||||||
SyncIndex lastIndex;
|
SyncIndex lastIndex;
|
||||||
SyncTerm lastTerm;
|
SyncTerm lastTerm;
|
||||||
SyncTerm privateTerm;
|
int64_t startTime;
|
||||||
int32_t ack;
|
int32_t ack;
|
||||||
int32_t code;
|
int32_t code;
|
||||||
|
SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid
|
||||||
} SyncSnapshotRsp;
|
} SyncSnapshotRsp;
|
||||||
|
|
||||||
SyncSnapshotRsp* syncSnapshotRspBuild(int32_t vgId);
|
SyncSnapshotRsp* syncSnapshotRspBuild(int32_t vgId);
|
||||||
|
|
Loading…
Reference in New Issue