Skip to content

Commit

Permalink
Add lease manager worker documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nvinuesa committed Feb 2, 2024
1 parent 737ad81 commit 66e26d0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions worker/lease/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2023 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

// Package lease, also known as the manager, manages the leases used by
// individual Juju workers.
//
// Workers will claim a lease, and they are either attributed (i.e., the workers
// gets the lease ) or blocked (i.e., the worker is waiting for a lease to
// become available).
// In the latter case, the manager will keep track of all the blocked claims.
// When a worker's lease expires or gets revoked, then the manager will
// re-attribute it to one of other workers, thus unblocking them and satisfying
// their claim.
// In the special case where a worker is upgrading an application, it will ask
// the manager to "pin" the lease. This means that the lease will not expire or
// be revoked during the upgrade, and the validity of the lease will get
// refreshed once the upgrade has completed. The overall effect is that the
// application unit does not lose leadership during an upgrade.
package lease

0 comments on commit 66e26d0

Please sign in to comment.