Skip to content

Commit

Permalink
kvserver: add doc for writeUnreplicatedSST
Browse files Browse the repository at this point in the history
Epic: CRDB-220
Release note: None
  • Loading branch information
tbg committed Feb 13, 2023
1 parent 43248a5 commit 31ae36f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/kv/kvserver/replica_raftstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,14 +661,21 @@ func (r *Replica) applySnapshot(
return nil
}

// writeUnreplicatedSST creates an SST for snapshot application that
// covers the RangeID-unreplicated keyspace. A range tombstone is
// laid down and the Raft state provided by the arguments is overlaid
// onto it.
//
// TODO(sep-raft-log): when is `nonempty` ever false? We always
// perform a number of writes to this SST.
func writeUnreplicatedSST(
ctx context.Context,
id storage.FullReplicaID,
st *cluster.Settings,
meta raftpb.SnapshotMetadata,
hs raftpb.HardState,
sl *logstore.StateLoader,
) (*storage.MemFile, bool, error) {
) (_ *storage.MemFile, nonempty bool, _ error) {
unreplicatedSSTFile := &storage.MemFile{}
unreplicatedSST := storage.MakeIngestionSSTWriter(
ctx, st, unreplicatedSSTFile,
Expand Down

0 comments on commit 31ae36f

Please sign in to comment.