Skip to content

Conversation

@tbg
Copy link
Member

@tbg tbg commented Nov 14, 2025

Extracted from here.

In this commit, we make this the only way to represent a lease transfer, and
remove the explicit AddLease and RemoveLease operations. This removes ambiguity,
and makes the code more approachable.

The downside to this change is that one needs to inspect the particular change
to determine whether it requires a replication change (or only a lease
transfer). But this strikes me as a worthwhile trade-off.

Informs #157757.

Epic: CRDB-55052

tbg added 2 commits November 14, 2025 14:56
Because we don't want to refer to a store multiple times in a slice of pending
changes, promotions and demotions could already "wrap" a lease transfer.

In this commit, we make this the only way to represent a lease transfer, and
remove the explicit AddLease and RemoveLease operations. This removes ambiguity,
and makes the code more approachable.

The downside to this change is that one needs to inspect the particular change
to determine whether it requires a replication change (or only a lease
transfer). But this strikes me as a worthwhile trade-off.

Informs cockroachdb#157757.

Epic: CRDB-55052
@blathers-crl
Copy link

blathers-crl bot commented Nov 14, 2025

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg
Copy link
Member Author

tbg commented Nov 14, 2025

@sumeerbhola noted on #157118:

I'd prefer to undo this change from this PR and have you tackle this separately. The main reason is that I am nervous about prev.ReplicaType == next.ReplicaType, given that we always normalize the next.ReplicaType to be VOTER_FULL or NON_VOTER.

I still need to look into this.

@tbg
Copy link
Member Author

tbg commented Nov 21, 2025

I'll put this on hold for now, there is a lot of activity in that part of the codebase right now.

@tbg tbg closed this Nov 21, 2025
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.

2 participants