Skip to content

Commit 68e84f8

Browse files
committed
raft: remove remnants of MsgStorageApply
Epic: none Release note: none
1 parent 8d32b1e commit 68e84f8

File tree

5 files changed

+3
-30
lines changed

5 files changed

+3
-30
lines changed

pkg/kv/kvserver/replica_raft.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,8 +1402,6 @@ func splitLocalStorageMsgs(
14021402
panic("two MsgStorageAppend")
14031403
}
14041404
msgStorageAppend = msgs[i]
1405-
case raftpb.MsgStorageApply:
1406-
// ignore
14071405
default:
14081406
// Local storage messages will always be at the end of the messages slice,
14091407
// so we can terminate iteration as soon as we reach any other message
@@ -1881,12 +1879,6 @@ func (r *Replica) sendRaftMessages(
18811879
// Instead, we handle messages to LocalAppendThread inline on the raft
18821880
// scheduler goroutine, so this code path is unused.
18831881
panic("unsupported, currently processed inline on raft scheduler goroutine")
1884-
case raft.LocalApplyThread:
1885-
// To local apply thread.
1886-
// NOTE: we don't currently split apply work off into an async goroutine.
1887-
// Instead, we handle messages to LocalAppendThread inline on the raft
1888-
// scheduler goroutine, so this code path is unused.
1889-
panic("unsupported, currently processed inline on raft scheduler goroutine")
18901882
case raftpb.PeerID(r.ReplicaID()):
18911883
// To local raft state machine, from local storage append and apply work.
18921884
// NOTE: For async Raft log appends, these messages come from calls to

pkg/raft/raft.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ const (
4848
// log entries and snapshots to stable storage. The identifier is used as a
4949
// target for MsgStorageAppend messages.
5050
LocalAppendThread pb.PeerID = math.MaxUint64
51-
// LocalApplyThread is a reference to a local thread that applies committed
52-
// log entries to the local state machine. The identifier is used as a
53-
// target for MsgStorageApply messages.
54-
LocalApplyThread pb.PeerID = math.MaxUint64 - 1
5551
)
5652

5753
// Possible values for CampaignType

pkg/raft/raftpb/raft.proto

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ enum MessageType {
5858
MsgPreVoteResp = 18;
5959
MsgStorageAppend = 19;
6060
MsgStorageAppendResp = 20;
61-
MsgStorageApply = 21;
62-
MsgStorageApplyResp = 22;
6361
MsgForgetLeader = 23;
6462
MsgFortifyLeader = 24;
6563
MsgFortifyLeaderResp = 25;
@@ -68,7 +66,7 @@ enum MessageType {
6866
// isResponseMsg arrays in raft/util.go and update the corresponding tests in
6967
// raft/util_test.go.
7068

71-
reserved 12, 15, 16;
69+
reserved 12, 15, 16, 21, 22;
7270
}
7371

7472
message Message {
@@ -108,7 +106,7 @@ message Message {
108106
optional bytes context = 12 [(gogoproto.nullable) = true];
109107
// responses are populated by a raft node to instruct storage threads on how
110108
// to respond and who to respond to when the work associated with a message
111-
// is complete. Populated for MsgStorageAppend and MsgStorageApply messages.
109+
// is complete. Populated for MsgStorageAppend only.
112110
repeated Message responses = 14 [(gogoproto.nullable) = false];
113111

114112
// match is the log index up to which the follower's log must persistently

pkg/raft/util.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ var isLocalMsg = [...]bool{
3333
pb.MsgSnapStatus: true,
3434
pb.MsgStorageAppend: true,
3535
pb.MsgStorageAppendResp: true,
36-
pb.MsgStorageApply: true,
37-
pb.MsgStorageApplyResp: true,
3836
}
3937

4038
var isResponseMsg = [...]bool{
@@ -44,7 +42,6 @@ var isResponseMsg = [...]bool{
4442
pb.MsgUnreachable: true,
4543
pb.MsgPreVoteResp: true,
4644
pb.MsgStorageAppendResp: true,
47-
pb.MsgStorageApplyResp: true,
4845
pb.MsgFortifyLeaderResp: true,
4946
}
5047

@@ -97,7 +94,7 @@ func IsMsgIndicatingLeader(msgt pb.MessageType) bool {
9794
}
9895

9996
func IsLocalMsgTarget(id pb.PeerID) bool {
100-
return id == LocalAppendThread || id == LocalApplyThread
97+
return id == LocalAppendThread
10198
}
10299

103100
// senderHasMsgTerm returns true if the message type is one that should have
@@ -250,8 +247,6 @@ func describeTarget(id pb.PeerID) string {
250247
return "None"
251248
case LocalAppendThread:
252249
return "AppendThread"
253-
case LocalApplyThread:
254-
return "ApplyThread"
255250
default:
256251
return fmt.Sprintf("%x", id)
257252
}

pkg/raft/util_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ func TestIsLocalMsg(t *testing.T) {
9393
{pb.MsgPreVoteResp, false},
9494
{pb.MsgStorageAppend, true},
9595
{pb.MsgStorageAppendResp, true},
96-
{pb.MsgStorageApply, true},
97-
{pb.MsgStorageApplyResp, true},
9896
{pb.MsgForgetLeader, false},
9997
{pb.MsgFortifyLeader, false},
10098
{pb.MsgFortifyLeaderResp, false},
@@ -131,8 +129,6 @@ func TestIsResponseMsg(t *testing.T) {
131129
{pb.MsgPreVoteResp, true},
132130
{pb.MsgStorageAppend, false},
133131
{pb.MsgStorageAppendResp, true},
134-
{pb.MsgStorageApply, false},
135-
{pb.MsgStorageApplyResp, true},
136132
{pb.MsgForgetLeader, false},
137133
{pb.MsgFortifyLeader, false},
138134
{pb.MsgFortifyLeaderResp, true},
@@ -170,8 +166,6 @@ func TestMsgFromLeader(t *testing.T) {
170166
{pb.MsgPreVoteResp, false},
171167
{pb.MsgStorageAppend, false},
172168
{pb.MsgStorageAppendResp, false},
173-
{pb.MsgStorageApply, false},
174-
{pb.MsgStorageApplyResp, false},
175169
{pb.MsgForgetLeader, false},
176170
{pb.MsgFortifyLeader, true},
177171
{pb.MsgFortifyLeaderResp, false},
@@ -213,8 +207,6 @@ func TestMsgIndicatingLeader(t *testing.T) {
213207
{pb.MsgPreVoteResp, false},
214208
{pb.MsgStorageAppend, false},
215209
{pb.MsgStorageAppendResp, false},
216-
{pb.MsgStorageApply, false},
217-
{pb.MsgStorageApplyResp, false},
218210
{pb.MsgForgetLeader, false},
219211
{pb.MsgFortifyLeader, true},
220212
{pb.MsgFortifyLeaderResp, false},

0 commit comments

Comments
 (0)