orchestration

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BisectInput

type BisectInput struct {
	FailedGroups []Group           `json:"failedGroups"`
	MinGroupSize int               `json:"minGroupSize"`
	Round        int               `json:"round"`
	TopologyKey  string            `json:"topologyKey,omitempty"`
	NodeLabels   map[string]string `json:"nodeLabels,omitempty"` // node name → topology domain value
}

BisectInput holds inputs for one round of binary-search fault isolation.

type BisectResult

type BisectResult struct {
	Groups    []Group `json:"groups"`
	Converged bool    `json:"converged"`
}

BisectResult holds the output of one bisection round.

func Bisect

func Bisect(input BisectInput) BisectResult

Bisect splits each failed group in half for the next round. Groups at or below minGroupSize are kept as-is (convergence). When TopologyKey is set, splits are done by topology domains to preserve locality. When TopologyKey is empty, nodes are split by name order.

type BothHalvesPassResult

type BothHalvesPassResult struct {
	// Domain is the topology domain of the parent group (if any).
	Domain string
	// HalfA is the node list of the first child that passed.
	HalfA []string
	// HalfB is the node list of the second child that passed.
	HalfB []string
}

BothHalvesPassResult represents a bisection parent group where both child halves passed individually, indicating an infrastructure fault.

func DetectBothHalvesPass

func DetectBothHalvesPass(groups []GroupResult) []BothHalvesPassResult

DetectBothHalvesPass finds pairs of sibling bisection groups where both passed, indicating a potential infrastructure fault at the boundary.

type DiagnoseScreenInput

type DiagnoseScreenInput struct {
	// Nodes is the full set of target nodes with their topology labels.
	Nodes []NodeInfo `json:"nodes"`
	// TopologyKey is the node label key for topology-aware grouping.
	// When empty, nodes are grouped into disjoint chunks of ceil(sqrt(N)).
	TopologyKey string `json:"topologyKey,omitempty"`
}

DiagnoseScreenInput holds inputs for Stage 1 screening group generation.

type Group

type Group struct {
	Name     string   `json:"name"`
	Nodes    []string `json:"nodes"`
	Domains  []string `json:"domains,omitempty"`
	Overflow bool     `json:"overflow,omitempty"`
}

Group is the output of partitioning — a set of nodes for one Job.

func BuildConfirmationGroups

func BuildConfirmationGroups(suspectNodes []string, healthyNodes []string) []Group

BuildConfirmationGroups creates one group per suspect node, each paired with a known-healthy node for confirmation testing.

func BuildCrossBoundaryGroups

func BuildCrossBoundaryGroups(halfA, halfB []string, probeIdx int) []Group

BuildCrossBoundaryGroups creates two non-overlapping mixed groups from two halves of a bisection group. Mix-1 takes the first half of each side, Mix-2 takes the second half. Both can run in parallel (no node overlap).

func PartitionNodes

func PartitionNodes(input PartitionInput) ([]Group, error)

PartitionNodes divides nodes into groups. When TopologyKey is set, groups are packed into the minimum number of topology domains. When TopologyKey is empty, nodes are chunked by name order. Every target node appears in at least one group (coverage guarantee).

func ScreenGroups

func ScreenGroups(input DiagnoseScreenInput) ([]Group, error)

ScreenGroups generates Stage 1a screening groups for adaptive fault isolation. With a topology key, each unique domain value becomes one group. Without a topology key, nodes are split into disjoint groups of ceil(sqrt(N)).

type GroupResult

type GroupResult struct {
	Name    string
	Nodes   []string
	Domains []string
	Passed  bool
}

DetectBothHalvesPass identifies bisection sibling pairs where both halves succeeded. Sibling groups are identified by the naming convention: bisect-R-Ia and bisect-R-Ib share parent I.

type NodeInfo

type NodeInfo struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels,omitempty"`
}

NodeInfo describes a node for partitioning.

type PartitionInput

type PartitionInput struct {
	Nodes        []NodeInfo // discovered target nodes
	NodesPerJob  int        // from adapter.NodesRequired()
	TopologyKey  string     // from spec.orchestration.topology.topologyKey (empty = no topology)
	StrictDomain bool       // when true, one group per domain at its natural size (no borrowing)
}

PartitionInput holds inputs for node partitioning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL