Skip to content

Commit

Permalink
kvserver: add some TODOs about future renames, clarify some comments
Browse files Browse the repository at this point in the history
Epic: CRDB-220
Release note: None
  • Loading branch information
tbg committed Dec 21, 2022
1 parent 7151234 commit edf6976
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/app_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import (
)

type appBatchStats struct {
// TODO(sep-raft-log):
// numEntries
// numEntriesBytes
// numEntriesEmpty
numMutations int
numEntriesProcessed int
numEntriesProcessedBytes int64
Expand Down
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/apply/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 4 additions & 2 deletions pkg/kv/kvserver/replica_app_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/replica_application_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit edf6976

Please sign in to comment.