Skip to content

Commit af4a003

Browse files
committed
kvserver: add TODO for using a cheaper batch
Epic: none Release note: none
1 parent 3b44c52 commit af4a003

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/kv/kvserver/replica_application_state_machine.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ func (sm *replicaStateMachine) NewBatch() apply.Batch {
143143
// make it safer.
144144
b.r = r
145145
b.applyStats = &sm.applyStats
146+
// TODO(#144627): most commands do not need to read. Use NewWriteBatch because
147+
// it is more efficient. If there are exceptions, sparingly use NewReader or
148+
// NewBatch (if it needs to read its own writes, which is unlikely).
146149
b.batch = r.store.TODOEngine().NewBatch()
147150
r.mu.RLock()
148151
b.state = r.shMu.state

0 commit comments

Comments
 (0)