@@ -379,13 +379,19 @@ and this can be done via the `spec.Strategy` field in a Lease.
379
379
The `Strategy` field signals to the coordinated leader election controller the
380
380
appropriate algorithm to use when selecting leaders.
381
381
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.
389
395
390
396
# ### Alternative for Strategy
391
397
@@ -525,9 +531,6 @@ type LeaseCandidateSpec struct {
525
531
// CanLeadLease indicates the name of the lease that the candidate may lead
526
532
CanLeadLease string
527
533
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
-
531
534
// FIELDS DUPLICATED FROM LEASE
532
535
533
536
// leaseDurationSeconds is a duration that candidates for a lease need
@@ -545,12 +548,6 @@ type LeaseCandidateSpec struct {
545
548
Each LeaseCandidate lease may only lead one lock. If the same component wishes to lead many leases,
546
549
a separate LeaseCandidate lease will be required for each lock.
547
550
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
-
554
551
### Comparison of leader election
555
552
556
553
| | Lease Based Leader Election | Coordinated Leader Election |
0 commit comments