Skip to content

Commit c1a814c

Browse files
authored
chore: gate role-probe by engine-authoritative version (#10283)
1 parent 89a8716 commit c1a814c

7 files changed

Lines changed: 853 additions & 39 deletions

File tree

apis/apps/v1/componentdefinition_types.go

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,9 +1575,30 @@ type ComponentLifecycleActions struct {
15751575
// Without this, services that rely on roleSelectors might improperly direct traffic to wrong replicas.
15761576
//
15771577
// Expected output of this action:
1578-
// - On Success: The determined role of the replica, which must align with one of the roles specified
1579-
// in the component definition.
1580-
// - On Failure: An error message, if applicable, indicating why the action failed.
1578+
// - On Success: The determined role of the replica, which must align with one of the roles
1579+
// specified in the component definition. Stdout MUST be one of the two forms below:
1580+
//
1581+
// <role> // single-token form
1582+
// <role> <roleVersion> // versioned form
1583+
//
1584+
// The two tokens are separated by whitespace (spaces, tabs, or newlines).
1585+
// <roleVersion> is an optional unsigned 64-bit decimal integer that
1586+
// carries the component's authoritative role version for stale-role
1587+
// handling, especially stale exclusive-role claims. A versioned
1588+
// result is accepted only when its <roleVersion> is newer than the
1589+
// versioned result the controller has already accepted for this Pod.
1590+
// The version should represent the complete role fact. For an
1591+
// exclusive primary role, identical versions reported by different
1592+
// replicas must not describe contradictory primary ownership.
1593+
// <role> remains a valid single-token form. Stdout that looks
1594+
// versioned but whose second token is not an unsigned 64-bit decimal
1595+
// integer, or stdout with three or more whitespace-separated tokens,
1596+
// is rejected as malformed and the Pod's role label is not updated.
1597+
// A component may migrate a Pod from the single-token form to the
1598+
// versioned form. After a Pod has reported the versioned form,
1599+
// later single-token results from that Pod are ignored to avoid
1600+
// downgrading from authoritative role-version ordering.
1601+
// - On Failure: An error message, if applicable, indicating why the action failed.
15811602
//
15821603
// Note: This field is immutable once it has been set.
15831604
//

config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8893,9 +8893,30 @@ spec:
88938893
Without this, services that rely on roleSelectors might improperly direct traffic to wrong replicas.
88948894

88958895
Expected output of this action:
8896-
- On Success: The determined role of the replica, which must align with one of the roles specified
8897-
in the component definition.
8898-
- On Failure: An error message, if applicable, indicating why the action failed.
8896+
- On Success: The determined role of the replica, which must align with one of the roles
8897+
specified in the component definition. Stdout MUST be one of the two forms below:
8898+
8899+
<role> // single-token form
8900+
<role> <roleVersion> // versioned form
8901+
8902+
The two tokens are separated by whitespace (spaces, tabs, or newlines).
8903+
<roleVersion> is an optional unsigned 64-bit decimal integer that
8904+
carries the component's authoritative role version for stale-role
8905+
handling, especially stale exclusive-role claims. A versioned
8906+
result is accepted only when its <roleVersion> is newer than the
8907+
versioned result the controller has already accepted for this Pod.
8908+
The version should represent the complete role fact. For an
8909+
exclusive primary role, identical versions reported by different
8910+
replicas must not describe contradictory primary ownership.
8911+
<role> remains a valid single-token form. Stdout that looks
8912+
versioned but whose second token is not an unsigned 64-bit decimal
8913+
integer, or stdout with three or more whitespace-separated tokens,
8914+
is rejected as malformed and the Pod's role label is not updated.
8915+
A component may migrate a Pod from the single-token form to the
8916+
versioned form. After a Pod has reported the versioned form,
8917+
later single-token results from that Pod are ignored to avoid
8918+
downgrading from authoritative role-version ordering.
8919+
- On Failure: An error message, if applicable, indicating why the action failed.
88998920

89008921
Note: This field is immutable once it has been set.
89018922
properties:

0 commit comments

Comments
 (0)