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 #31618.

Release note: None
  • Loading branch information
tbg committed Oct 22, 2018
1 parent 2998190 commit 0bf41dd
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 @@ -4323,16 +4323,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 storagepb.RaftCommand
Expand Down

0 comments on commit 0bf41dd

Please sign in to comment.