@@ -46,11 +46,11 @@ const (
46
46
None pb.PeerID = 0
47
47
// LocalAppendThread is a reference to a local thread that saves unstable
48
48
// log entries and snapshots to stable storage. The identifier is used as a
49
- // target for MsgStorageAppend messages when AsyncStorageWrites is enabled .
49
+ // target for MsgStorageAppend messages.
50
50
LocalAppendThread pb.PeerID = math .MaxUint64
51
51
// LocalApplyThread is a reference to a local thread that applies committed
52
52
// log entries to the local state machine. The identifier is used as a
53
- // target for MsgStorageApply messages when AsyncStorageWrites is enabled .
53
+ // target for MsgStorageApply messages.
54
54
LocalApplyThread pb.PeerID = math .MaxUint64 - 1
55
55
)
56
56
@@ -159,9 +159,9 @@ type Config struct {
159
159
// threads are not responsible for understanding the response messages, only
160
160
// for delivering them to the correct target after performing the storage
161
161
// write.
162
- // TODO(#129411 ): deprecate !AsyncStorageWrites mode as it's not used in
163
- // CRDB .
164
- AsyncStorageWrites bool
162
+ // TODO(pav-kv ): this comment is a remnant of the AsyncStorageWrites option,
163
+ // which is now implicitly always true. Move the comment to a better place .
164
+
165
165
// LazyReplication instructs raft to hold off constructing MsgApp messages
166
166
// eagerly in reaction to Step() calls.
167
167
//
@@ -185,7 +185,8 @@ type Config struct {
185
185
//
186
186
// Despite its name (preserved for compatibility), this quota applies across
187
187
// Ready structs to encompass all outstanding entries in unacknowledged
188
- // MsgStorageApply messages when AsyncStorageWrites is enabled.
188
+ // MsgStorageApply messages.
189
+ // TODO(pav-kv): make the name better.
189
190
MaxCommittedSizePerReady uint64
190
191
// MaxUncommittedEntriesSize limits the aggregate byte size of the
191
192
// uncommitted entries that may be appended to a leader's log. Once this
@@ -558,13 +559,11 @@ func (r *raft) hardState() pb.HardState {
558
559
// next Ready handling cycle, except in one condition below.
559
560
//
560
561
// Certain message types are scheduled for being sent *after* the unstable state
561
- // is durably persisted in storage. If AsyncStorageWrites config flag is true,
562
- // the responsibility of upholding this condition is on the application, so the
563
- // message will be handed over via the next Ready as usually; if false, the
564
- // message will skip one Ready handling cycle, and will be sent after the
565
- // application has persisted the state.
566
- //
567
- // TODO(pav-kv): remove this special case after !AsyncStorageWrites is removed.
562
+ // is durably persisted in storage. These messages are nevertheless included in
563
+ // Ready.Messages, and the responsibility of upholding this condition is on the
564
+ // application.
565
+ // TODO(pav-kv): make this requirement explicit in the API, instead of mixing
566
+ // the two kinds of messages together.
568
567
func (r * raft ) send (m pb.Message ) {
569
568
if m .From == None {
570
569
m .From = r .id
0 commit comments