diff --git a/pkg/kv/kvserver/app_batch.go b/pkg/kv/kvserver/app_batch.go index 18c5f054c126..33de41be5754 100644 --- a/pkg/kv/kvserver/app_batch.go +++ b/pkg/kv/kvserver/app_batch.go @@ -24,6 +24,10 @@ import ( ) type appBatchStats struct { + // TODO(sep-raft-log): + // numEntries + // numEntriesBytes + // numEntriesEmpty numMutations int numEntriesProcessed int numEntriesProcessedBytes int64 diff --git a/pkg/kv/kvserver/apply/task.go b/pkg/kv/kvserver/apply/task.go index a34c46051f05..b6063c0de096 100644 --- a/pkg/kv/kvserver/apply/task.go +++ b/pkg/kv/kvserver/apply/task.go @@ -71,6 +71,10 @@ var ErrRemoved = errors.New("replica removed") type EphemeralBatch interface { // Stage inserts a Command into the Batch. In doing so, the Command is // checked for rejection and a CheckedCommand is returned. + // + // TODO(tbg): consider renaming this to Add, so that in implementations + // of this we less unambiguously refer to "staging" commands into the + // pebble batch. Stage(context.Context, Command) (CheckedCommand, error) // Close closes the batch and releases any resources that it holds. Close() diff --git a/pkg/kv/kvserver/replica_app_batch.go b/pkg/kv/kvserver/replica_app_batch.go index e5032dcf70b2..4b93fcd4d0ad 100644 --- a/pkg/kv/kvserver/replica_app_batch.go +++ b/pkg/kv/kvserver/replica_app_batch.go @@ -124,6 +124,10 @@ func (b *replicaAppBatch) Stage( return nil, err } + // TODO(tbg): if we rename Stage to Add we could less ambiguously + // use the verb "stage" instead of "add" for all of the methods + // below. + if err := b.runPreAddTriggersReplicaOnly(ctx, cmd); err != nil { return nil, err } @@ -197,8 +201,6 @@ func (b *replicaAppBatch) runPreAddTriggersReplicaOnly( // staged in the replicaAppBatch's write batch. // // May mutate `cmd`. -// -// All errors from this method are fatal for this Replica. func (b *replicaAppBatch) runPostAddTriggersReplicaOnly( ctx context.Context, cmd *replicatedCmd, ) error { diff --git a/pkg/kv/kvserver/replica_application_state_machine.go b/pkg/kv/kvserver/replica_application_state_machine.go index f260fdb1df5f..f887820b99e6 100644 --- a/pkg/kv/kvserver/replica_application_state_machine.go +++ b/pkg/kv/kvserver/replica_application_state_machine.go @@ -44,7 +44,7 @@ import ( // TODO(ajwerner): add metrics to go with these stats. type applyCommittedEntriesStats struct { appBatchStats - numBatchesProcessed int + numBatchesProcessed int // TODO(sep-raft-log): numBatches stateAssertions int numConfChangeEntries int }