@@ -21,8 +21,8 @@ import (
2121 "github.com/cockroachdb/errors"
2222)
2323
24- // prepareSnapshotInput contains the data needed to prepare the on-disk state for a snapshot.
25- type prepareSnapshotInput struct {
24+ // prepareSnapApplyInput contains the data needed to prepare the on-disk state for a snapshot.
25+ type prepareSnapApplyInput struct {
2626 id storage.FullReplicaID
2727
2828 st * cluster.Settings
@@ -36,23 +36,24 @@ type prepareSnapshotInput struct {
3636 subsumedDescs []* roachpb.RangeDescriptor
3737}
3838
39- // preparedSnapshot contains the results of preparing the snapshot on disk.
40- type preparedSnapshot struct {
39+ // preparedSnapApply contains the results of preparing the snapshot for ingestion.
40+ // TODO: remove
41+ type preparedSnapApply struct {
4142 clearedSpan roachpb.Span
4243 clearedSubsumedSpans []roachpb.Span
4344}
4445
45- // prepareSnapshot writes the unreplicated SST for the snapshot and clears disk data for subsumed replicas.
46- func prepareSnapshot (ctx context.Context , input prepareSnapshotInput ) (preparedSnapshot , error ) {
46+ // prepareSnapApply writes the unreplicated SST for the snapshot and clears disk data for subsumed replicas.
47+ func prepareSnapApply (ctx context.Context , input prepareSnapApplyInput ) (preparedSnapApply , error ) {
4748 // Step 1: Write unreplicated SST
4849 unreplicatedSSTFile , clearedSpan , err := writeUnreplicatedSST (
4950 ctx , input .id , input .st , input .truncState , input .hardState , input .logSL ,
5051 )
5152 if err != nil {
52- return preparedSnapshot {}, err
53+ return preparedSnapApply {}, err
5354 }
5455 if err := input .writeSST (ctx , unreplicatedSSTFile .Data ()); err != nil {
55- return preparedSnapshot {}, err
56+ return preparedSnapApply {}, err
5657 }
5758
5859 var clearedSubsumedSpans []roachpb.Span
@@ -62,12 +63,12 @@ func prepareSnapshot(ctx context.Context, input prepareSnapshotInput) (preparedS
6263 input .desc , input .subsumedDescs ,
6364 )
6465 if err != nil {
65- return preparedSnapshot {}, err
66+ return preparedSnapApply {}, err
6667 }
6768 clearedSubsumedSpans = spans
6869 }
6970
70- return preparedSnapshot {
71+ return preparedSnapApply {
7172 clearedSpan : clearedSpan ,
7273 clearedSubsumedSpans : clearedSubsumedSpans ,
7374 }, nil
0 commit comments