Skip to content

kvserver: remove kv.atomic_replication_changes.enabled setting#61170

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
aayushshah15:20210226_stopDisablingAtomicReplicationChanges
Feb 27, 2021
Merged

kvserver: remove kv.atomic_replication_changes.enabled setting#61170
craig[bot] merged 1 commit intocockroachdb:masterfrom
aayushshah15:20210226_stopDisablingAtomicReplicationChanges

Conversation

@aayushshah15
Copy link
Copy Markdown
Contributor

This setting was added in 19.2 to provide a fallback against atomic
replication changes. They've now been a part of CockroachDB for over 3
releases. They're also a requirement for non-voting replicas.

Release note (backward-incompatible change): Removed the
kv.atomic_replication_changes.enabled cluster setting. All replication
changes on a range now use joint-consensus.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@aayushshah15 aayushshah15 force-pushed the 20210226_stopDisablingAtomicReplicationChanges branch from c03ae29 to a213209 Compare February 26, 2021 05:34
@aayushshah15 aayushshah15 requested a review from nvb February 26, 2021 05:34
@aayushshah15 aayushshah15 force-pushed the 20210226_stopDisablingAtomicReplicationChanges branch 2 times, most recently from 1ef691e to f44d179 Compare February 26, 2021 06:33
Copy link
Copy Markdown
Contributor

@nvb nvb left a 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: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @aayushshah15)


pkg/kv/kvserver/allocator.go, line 888 at r1 (raw file):

	zero := roachpb.ReplicationTarget{}

	// We're going to add another replica to the range which will change the

I don't understand why this allocator change is needed/allowed. Is it no longer applicable now that atomic replication changes are always enabled?


pkg/kv/kvserver/replica.go, line 91 at r1 (raw file):

// This has no effect until the cluster version is 19.2 or higher.
var UseAtomicReplicationChanges = settings.RegisterBoolSetting(
	"kv.atomic_replication_changes.enabled",

We'll want to add this to the retiredSettings map.

This setting was added in 19.2 to provide a fallback against atomic
replication changes. They've now been a part of CockroachDB for over 3
releases. They're also a requirement for non-voting replicas.

Release justification: removing old cluster setting incompatible with
21.1 features

Release note (backward-incompatible change): Removed the
`kv.atomic_replication_changes.enabled` cluster setting. All replication
changes on a range now use joint-consensus.
@aayushshah15 aayushshah15 force-pushed the 20210226_stopDisablingAtomicReplicationChanges branch from f44d179 to f65313e Compare February 26, 2021 06:52
Copy link
Copy Markdown
Contributor Author

@aayushshah15 aayushshah15 left a comment

Choose a reason for hiding this comment

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

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


pkg/kv/kvserver/allocator.go, line 888 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

I don't understand why this allocator change is needed/allowed. Is it no longer applicable now that atomic replication changes are always enabled?

I think this block of code was only needed when atomic replication changes were disabled, but it was instead used even with them turned on.

I think this bit of code should explain the purpose of this safeguard:

if numLiveReplicas < newQuorum {
  // Don't rebalance as we won't be able to make quorum after the rebalance
  // until the new replica has been caught up.
  return zero, zero, "", false
}

With atomic replication changes, we know we're not going to affect the quorum size during rebalancing so the safeguard provided by this block of code is not needed.


pkg/kv/kvserver/replica.go, line 91 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

We'll want to add this to the retiredSettings map.

Thanks for the pointer, done.

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 7 files at r1, 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nvanbenschoten)

@aayushshah15
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 27, 2021

Build succeeded:

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