File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ func (sm *replicaStateMachine) NewEphemeralBatch() apply.EphemeralBatch {
139
139
func (sm * replicaStateMachine ) NewBatch () apply.Batch {
140
140
r := sm .r
141
141
b := & sm .batch
142
+ // TODO(pav-kv): replicaAppBatch initialization below is bug-prone, we need to
143
+ // not forget resetting the fields that are local to one batch. Find a way to
144
+ // make it safer.
142
145
b .r = r
143
146
b .applyStats = & sm .applyStats
144
147
b .batch = r .store .TODOEngine ().NewBatch ()
@@ -148,6 +151,9 @@ func (sm *replicaStateMachine) NewBatch() apply.Batch {
148
151
* b .state .Stats = * r .mu .state .Stats
149
152
b .closedTimestampSetter = r .mu .closedTimestampSetter
150
153
r .mu .RUnlock ()
154
+ b .changeRemovesReplica = false
155
+ b .changeTruncatesSideloadedFiles = false
156
+ // TODO(pav-kv): what about b.ab and b.followerStoreWriteBytes?
151
157
b .start = timeutil .Now ()
152
158
return b
153
159
}
You can’t perform that action at this time.
0 commit comments