-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storage: delete all "raft log as part of snapshots" code #44567
storage: delete all "raft log as part of snapshots" code #44567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 7 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner, @irfansharif, @nvanbenschoten, and @tbg)
pkg/storage/replica_raftstorage.go, line 443 at r1 (raw file):
Iter *rditer.ReplicaDataIterator // The replica state within the snapshot. State storagepb.ReplicaState
This needs a newline or a gofmt.
pkg/storage/replica_raftstorage.go, line 1057 at r1 (raw file):
} // extractRangeFromEntries returns a string representation of the range of
This is no longer used
pkg/storage/store_snapshot.go, line 762 at r1 (raw file):
} type errMustRetrySnapshotDueToTruncation struct {
This is no longer used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is another one I'd let @tbg sign off on as well before merging.
yay deleting code
keep going! What else can we delete?
Reviewed 5 of 7 files at r1.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @irfansharif and @tbg)
pkg/storage/replica_raftstorage.go, line 795 at r1 (raw file):
} // Update Raft entries.
Could you add a comment here explaining what now happens with the recipient's Raft log?
pkg/storage/store_snapshot.go, line 288 at r1 (raw file):
} expLen := inSnap.State.RaftAppliedIndex - inSnap.State.TruncatedState.Index
Is it worth asserting that this is always 0 so that we know we were never given any log entries from old versions of CRDB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTRs, I'll wait for Tobi to chime in.
What else can we delete?
I'm only really familiar with the more recent deprecations, you folks might know better. But very naively grepping for 19.{1,2}
in code comments (I'm very likely wrong here, didn't dig in deeper) I see:
ChangeReplicasTrigger
has a few deprecated fields we should no longer be using, could strip out a bit. Also this and this- There's a bit of cleanup around unsplit command code
- Minor cleanup around sorting behavior of
InternalReplicas
here - Some stats handling here
- Leftover TODOs around intent handling here
- Code around checking if replicated eval result side effects are trivial
- Can probably remove this stats inconsistency panic hatch
Other than this, I can only think of stuff to clean up post #39182. Pre-emptive snapshots would be a nice one to strip out. RaftTruncatedStateLegacyKey is another, which IIUC would let us delete cmd_truncate_log.go
+ handleTruncatedStateBelowRaft
in its entirety.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @ajwerner, @nvanbenschoten, and @tbg)
pkg/storage/replica_raftstorage.go, line 443 at r1 (raw file):
Previously, ajwerner wrote…
This needs a newline or a gofmt.
Ugh, for some reason my goland filewatchers keep resetting. I should figure out what's happening.
pkg/storage/replica_raftstorage.go, line 795 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Could you add a comment here explaining what now happens with the recipient's Raft log?
Done.
pkg/storage/replica_raftstorage.go, line 1057 at r1 (raw file):
Previously, ajwerner wrote…
This is no longer used
Done (was leaning on CI lint checks).
pkg/storage/store_snapshot.go, line 288 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Is it worth asserting that this is always 0 so that we know we were never given any log entries from old versions of CRDB?
Assert what to zero? Not sure I follow. (I have to clean up the code block below this comment, but stepping out for a bit.)
pkg/storage/store_snapshot.go, line 762 at r1 (raw file):
Previously, ajwerner wrote…
This is no longer used.
Done (was leaning on CI lint checks).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @ajwerner, @nvanbenschoten, and @tbg)
pkg/storage/store_snapshot.go, line 288 at r1 (raw file):
Previously, irfansharif (irfan sharif) wrote…
Assert what to zero? Not sure I follow. (I have to clean up the code block below this comment, but stepping out for a bit.)
Oh, reviewable was not rendering the diff for some reason prior. I saw an isolated comment in the middle of no where. Done.
Raft log entries are no longer sent along with snapshots as of v19.2 (more specifically, cockroachdb#35701), we can/should delete all code around the sending/handling of log entries in snapshots before v20.1 is cut. This simplifies a few snapshot related protos and naturally obviates the need to handle sideloaded proposals within snapshots. Release note: None
8d2f75e
to
814e918
Compare
Hmm, it's late here and maybe I'm asleep at the wheel, but ranges that still use the legacy replicated truncated state must include the raft log. I don't think it's safe to remove this until we have #42822 and have migrated across it? |
You're right. Going to let this sit for now. |
Raft log entries are no longer sent along with snapshots as of v19.2
(more specifically, #35701), we can/should delete all code around the
sending/handling of log entries in snapshots before v20.1 is cut. This
simplifies a few snapshot related protos and naturally obviates the need
to handle sideloaded proposals within snapshots.
Release note: None