Skip to content

Commit

Permalink
raft_serverpb: add new ExtraMessage types for the snapshot gen preche…
Browse files Browse the repository at this point in the history
…ck process (#1245)

* Add a new extra message for snapshot send precheck

Signed-off-by: Bisheng Huang <[email protected]>

* use a boolean

Signed-off-by: Bisheng Huang <[email protected]>

* raft_serverpb: add new ExtraMessage types for the snapshot gen precheck process

This commit adds two new new ExtraMessage types that are part of the snapshot
gen precheck process.

Before a leader generates a snapshot, it sends a precheck request to the target
follower. The follower responds with a boolean value indicating whether the
check succeeds.

Signed-off-by: Bisheng Huang <[email protected]>

* make name shorter

Signed-off-by: Bisheng Huang <[email protected]>

* include proto.lock change

Signed-off-by: Bisheng Huang <[email protected]>

---------

Signed-off-by: Bisheng Huang <[email protected]>
Co-authored-by: Neil Shen <[email protected]>
  • Loading branch information
hbisheng and overvenus authored Jun 7, 2024
1 parent df42997 commit 0ad602a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions proto/raft_serverpb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ enum ExtraMessageType {
MsgGcPeerResponse = 12;
MsgFlushMemtable = 13;
MsgRefreshBuckets = 14;
// Messages for the snapshot gen precheck process.
MsgSnapGenPrecheckRequest = 15;
MsgSnapGenPrecheckResponse = 16;
}

message FlushMemtable {
Expand Down Expand Up @@ -293,4 +296,7 @@ message ExtraMessage {
AvailabilityContext availability_context = 8;
// notice the peer to refresh buckets version
RefreshBuckets refresh_buckets = 9;
// snap_gen_precheck_passed is used to indicate the precheck result when
// a follower responds to a leader's snapshot gen precheck request.
bool snap_gen_precheck_passed = 10;
}
13 changes: 13 additions & 0 deletions scripts/proto.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17491,6 +17491,14 @@
{
"name": "MsgRefreshBuckets",
"integer": 14
},
{
"name": "MsgSnapGenPrecheckRequest",
"integer": 15
},
{
"name": "MsgSnapGenPrecheckResponse",
"integer": 16
}
]
}
Expand Down Expand Up @@ -18199,6 +18207,11 @@
"id": 9,
"name": "refresh_buckets",
"type": "RefreshBuckets"
},
{
"id": 10,
"name": "snap_gen_precheck_passed",
"type": "bool"
}
]
}
Expand Down

0 comments on commit 0ad602a

Please sign in to comment.