Skip to content

Commit 5b1ebac

Browse files
committed
Update leaderless lease info
1 parent 50641e8 commit 5b1ebac

File tree

1 file changed

+13
-16
lines changed
  • keps/sig-api-machinery/4355-coordinated-leader-election

1 file changed

+13
-16
lines changed

keps/sig-api-machinery/4355-coordinated-leader-election/README.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,19 @@ and this can be done via the `spec.Strategy` field in a Lease.
379379
The `Strategy` field signals to the coordinated leader election controller the
380380
appropriate algorithm to use when selecting leaders.
381381

382-
We will allow the Coordinated Leader Election controller to create a Lease
383-
without a holder. If there are no candidate objects, the `Strategy` field will
384-
remain empty to indicate that the `Lease` is not managed by the CLE controller.
385-
Otherwise the strategy will always default to `MinimumCompatibilityVersion`. The
386-
`Lease` may also be updated by a third party to the desired `spec.Strategy` if
387-
an alternate strategy is preferred. This may be done either by the candidates,
388-
users, or additional controllers.
382+
We will allow for the existence of a lease without a holder. This will allow
383+
`Strategy` to be injected and preserved for leases that may not want to use the
384+
default selected by CLE. If there are no candidate objects, the `Strategy` field
385+
will remain empty to indicate that the `Lease` is not managed by the CLE
386+
controller. Otherwise the strategy will always default to
387+
`MinimumCompatibilityVersion`. The `Lease` may also be created or updated by a
388+
third party to the desired `spec.Strategy` if an alternate strategy is
389+
preferred. This may be done either by the candidates, users, or additional
390+
controllers.
391+
392+
Releasing a `Lease` will involve resetting the holderIdentity to `nil` instead
393+
of deletion. This will preserve `Strategy` when a `Lease` object is released and
394+
reacquired by another candidate.
389395

390396
#### Alternative for Strategy
391397

@@ -525,9 +531,6 @@ type LeaseCandidateSpec struct {
525531
// CanLeadLease indicates the name of the lease that the candidate may lead
526532
CanLeadLease string
527533

528-
// Strategy indicates the preferred strategy for the coordinated leader election controller to use.
529-
Strategy CoordinatedLeaseStrategy `json:"strategy,omitempty" protobuf:"string,6,opt,name=strategy"`
530-
531534
// FIELDS DUPLICATED FROM LEASE
532535

533536
// leaseDurationSeconds is a duration that candidates for a lease need
@@ -545,12 +548,6 @@ type LeaseCandidateSpec struct {
545548
Each LeaseCandidate lease may only lead one lock. If the same component wishes to lead many leases,
546549
a separate LeaseCandidate lease will be required for each lock.
547550

548-
If the `LeaseCandidate` objects do not agree on a value for the Strategy, we will have an ordering priority.
549-
For instance, we define `NewestCompatibilityVersion` > `OldestCompatibilityVersion`. This means that if
550-
a subset of candidates have `OldestCompatibilityVersion` and and subset have `NewestCompatibilityVersion`,
551-
coordinated leader election will pick `NewestCompatibilityVersion`. In order for `OldestCompatibilityVersion` to be used,
552-
all `LeaseCandidate` objects must publish the same `Strategy`.
553-
554551
### Comparison of leader election
555552

556553
| | Lease Based Leader Election | Coordinated Leader Election |

0 commit comments

Comments
 (0)