Skip to content
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

kvserver: remove detritus for old change replicas and preemptive snaps #72237

Merged
merged 11 commits into from
Oct 29, 2021

Conversation

tbg
Copy link
Member

@tbg tbg commented Oct 29, 2021

See individual commits.

  • kvserver: remove deprecated fields in ChangeReplicasTrigger
  • kvserver: improve comment on raft send buffer size
  • kvserver: improve comment on split trigger helper
  • kvserver: remove TODO for removing DisableEagerReplicaRemoval
  • kvserver: remove snapshot CanDecline flag
  • kvserver: reflect absence of preemptive snaps in more comments
  • kvserver: remove IsPreemptive()
  • kvserver: bump snapshotReservationWaitWarnThreshold
  • kvserver: add TODO about removing snapshot log sending code.
  • kvserver: assert that local descriptor "always" contains the replica
  • kvserver: remove env-defaults for snapshot rate limits

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg
Copy link
Member Author

tbg commented Oct 29, 2021

This is certainly going to break in CI in some way, but I think should still be ok for review.

@tbg tbg requested a review from a team October 29, 2021 16:07
@tbg tbg marked this pull request as ready for review October 29, 2021 16:07
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: nice cleanup.

Reviewed 6 of 6 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 1 of 1 files at r4, 10 of 10 files at r5, 8 of 8 files at r6, 3 of 3 files at r7, 1 of 1 files at r8, 2 of 2 files at r9, 2 of 2 files at r10, 1 of 1 files at r11, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @tbg)


pkg/kv/kvserver/raft.proto, line 174 at r5 (raw file):

    // by raft because at that point it is better to queue up the stream
    // than to cancel it.
    bool can_decline = 4;

Same here. We should reserve this field number as well.


pkg/roachpb/data.proto, line 228 at r1 (raw file):

  // TODO(tbg): when removing this, also rename internal_x_replicas to just
  // x_replicas and remove the getter.
  ReplicaChangeType deprecated_change_type = 1;

Should we mark these field numbers as reserved?

@tbg tbg force-pushed the deprecated-change-replicas branch from ad05310 to a432d57 Compare October 29, 2021 20:07
@tbg tbg requested a review from nvanbenschoten October 29, 2021 20:08
Copy link
Member Author

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR! I had to massage the assertion I added a little bit to account for the testing knob that some tests use (and which can violate the assertions).
Addressed the missing reserved fields too, so will merge on green.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten)

@tbg
Copy link
Member Author

tbg commented Oct 29, 2021

bors r=nvanbenschoten

@tbg
Copy link
Member Author

tbg commented Oct 29, 2021

bors r-

messed something up (I had picked up two unrelated commits in the last push, not sure how)

@craig
Copy link
Contributor

craig bot commented Oct 29, 2021

Canceled.

tbg added 11 commits October 29, 2021 23:10
These became obsolete long before we introduced long-running migration
(we switched to the new method of doing things in 19.2).  In the
meantime, all ranges have migrated into the applied state and in the
process, have conveniently flushed out any triggers still using the old
format from their logs. So we get to "just do this"; thanks,
long-running migrations.

Release note: None
It's used in 7+ nontrivial tests that have nothing to do with
preemptive snapshots.

Release note: None
Only preemptive snapshots specified CanDecline, and we haven't been
using those since 19.2. This also removes the corresponding rejection
enum reason `SnapshotResponse_DECLINED`, and retires the
`server.declined_reservation_timeout` cluster setting.

Release note: None
This was set before both the default range size and snapshot rate limit
changed. Re-do the math and adjust the constant.

Release note: None
I'll get to this, but the mission at hand is removing residual mentions
of preemptive snapshots.

Release note: None
This is an invariant that was established in [cockroachdb#40892]. We now check
it more aggressively. There is an awkward exception thanks to
uninitialized replicas.

[cockroachdb#40892]: cockroachdb#40892

Release note: None

fixupassert
The cluster settings should be used instead.  Neither env var was
referenced from our codebase, i.e. they are not used in roachtests.

Also, update a TODO.

Release note: None
@tbg tbg force-pushed the deprecated-change-replicas branch from a432d57 to 80a9eba Compare October 29, 2021 21:10
@tbg
Copy link
Member Author

tbg commented Oct 29, 2021

bors r=nvanbenschoten

@craig
Copy link
Contributor

craig bot commented Oct 29, 2021

Build succeeded:

@craig craig bot merged commit db229ca into cockroachdb:master Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants