Skip to content

Commit

Permalink
storage: remove spurious call to maybeInlineSideloadedRaftCommand
Browse files Browse the repository at this point in the history
Entries are "thinned" only when passed to `r.append()` (i.e. written
to disk) and they are always returned "fat" from `Entries()` (i.e.
Raft's way to get entries from disk). Consequently Raft never sees
thin entries and won't ask us to commit them.

Touches cockroachdb#31618.

Release note: None
  • Loading branch information
tbg committed Nov 16, 2018
1 parent 4523f98 commit 14ea230
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions pkg/storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -4357,16 +4357,9 @@ func (r *Replica) handleRaftReadyRaftMuLocked(
for _, e := range rd.CommittedEntries {
switch e.Type {
case raftpb.EntryNormal:
// Committed entries come straight from the Raft log. Consequently,
// sideloaded SSTables are not usually inlined.
if newEnt, err := maybeInlineSideloadedRaftCommand(
ctx, r.RangeID, e, r.raftMu.sideloaded, r.store.raftEntryCache,
); err != nil {
const expl = "maybeInlineSideloadedRaftCommand"
return stats, expl, errors.Wrap(err, expl)
} else if newEnt != nil {
e = *newEnt
}
// NB: Committed entries are handed to us by Raft. Raft does not
// know about sideloading. Consequently the entries here are all
// already inlined.

var commandID storagebase.CmdIDKey
var command storagebase.RaftCommand
Expand Down

0 comments on commit 14ea230

Please sign in to comment.