Documentation
¶
Index ¶
- Constants
- func ErrorCode(err error) string
- func IsBlocked(err error) bool
- type Blocker
- type Control
- type Current
- type DatabaseEvidence
- type Handler
- type Identity
- type LegacyEvidence
- type Member
- type OperationError
- type PreflightOptions
- type Readiness
- type Report
- type RetirementEvidence
- type RetirementOptions
- type Service
- func (s *Service) Drain(ctx context.Context, req TransitionRequest) (Report, error)
- func (s *Service) HardMaintenance(ctx context.Context, req TransitionRequest) (Report, error)
- func (s *Service) Preflight(ctx context.Context, opts PreflightOptions) (Report, error)
- func (s *Service) Reopen(ctx context.Context, req TransitionRequest) (Report, error)
- func (s *Service) RetireStaleMembers(ctx context.Context, opts RetirementOptions) (Report, error)
- func (s *Service) Status(ctx context.Context) (Report, error)
- type ServiceConfig
- type SignalBus
- type SignalHealth
- type TransitionRequest
Constants ¶
View Source
const ( SignalModeLocal = "local" SignalModeRedis = "redis" BlockerLegacyRunsNonterminal = "legacy_runs_nonterminal" BlockerLegacyDeliveriesPending = "legacy_deliveries_pending" BlockerLegacyTerminalHistoryInvalid = "legacy_terminal_history_invalid" BlockerLegacyEventPayloadInvalid = "legacy_event_payload_invalid" BlockerDatabaseClientsActive = "database_clients_active" BlockerClusterMembersRegistered = "cluster_members_registered" BlockerCurrentSchemaMismatch = "current_schema_mismatch" BlockerCurrentContractMismatch = "current_contract_mismatch" BlockerReplicasUnexpected = "replicas_unexpected" BlockerMemberReleaseMismatch = "member_release_mismatch" BlockerMemberSchemaMismatch = "member_schema_mismatch" BlockerMemberContractMismatch = "member_contract_mismatch" BlockerMemberSchemaChecksumMismatch = "member_schema_checksum_mismatch" BlockerMemberNotReady = "member_not_ready" BlockerReleaseIdentityMissing = "release_identity_missing" BlockerExpectedReplicasInvalid = "expected_replicas_invalid" BlockerClusterVersionConflict = "cluster_version_conflict" BlockerCutoverIDMismatch = "cutover_id_mismatch" BlockerTransitionNotAllowed = "transition_not_allowed" BlockerRuntimeRunsNonterminal = "runtime_runs_nonterminal" BlockerMaintenance = "maintenance" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Blocker ¶
type Blocker struct {
Code string `json:"code"`
Scope string `json:"scope"`
ID string `json:"id,omitempty"`
MessageRedacted string `json:"message_redacted,omitempty"`
}
Blocker is deliberately safe to expose to administrators and automation. It contains stable machine codes and redacted evidence, never payloads, credentials, database error strings, or Run input/output.
type Control ¶
type Control struct {
Mode string `json:"mode"`
ExpectedReplicas int32 `json:"expected_replicas"`
CutoverID uuid.UUID `json:"cutover_id"`
DrainStartedAt *time.Time `json:"drain_started_at,omitempty"`
DrainDeadlineAt *time.Time `json:"drain_deadline_at,omitempty"`
HardMaintenanceAt time.Time `json:"hard_maintenance_at"`
ReopenedAt *time.Time `json:"reopened_at,omitempty"`
Version int64 `json:"version"`
UpdatedAt time.Time `json:"updated_at"`
}
type Current ¶
type Current struct {
SchemaVersion int32 `json:"schema_version"`
SchemaChecksum string `json:"schema_checksum"`
MigrationName string `json:"migration_name,omitempty"`
RuntimeContractID string `json:"runtime_contract_id"`
RuntimeContractDigest string `json:"runtime_contract_digest"`
ReleaseID string `json:"release_id"`
GitSHA string `json:"git_sha"`
}
type DatabaseEvidence ¶
type DatabaseEvidence struct {
OtherClientBackends int64 `json:"other_client_backends"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
type LegacyEvidence ¶
type LegacyEvidence struct {
RunsTablePresent bool `json:"runs_table_present"`
NonterminalRuns int64 `json:"nonterminal_runs"`
PendingWebhookDeliveries int64 `json:"pending_webhook_deliveries"`
PendingRunDeliveries int64 `json:"pending_run_deliveries"`
PendingTaskCallbackDeliveries int64 `json:"pending_task_callback_deliveries"`
InvalidTerminalRuns int64 `json:"invalid_terminal_runs"`
InvalidRunEventPayloads int64 `json:"invalid_run_event_payloads"`
}
func (LegacyEvidence) PendingDeliveries ¶
func (e LegacyEvidence) PendingDeliveries() int64
type Member ¶
type Member struct {
InstanceID uuid.UUID `json:"instance_id"`
ReleaseID string `json:"release_id"`
GitSHA string `json:"git_sha"`
SchemaVersion int32 `json:"schema_version"`
SchemaChecksum string `json:"schema_checksum"`
RuntimeContractID string `json:"runtime_contract_id"`
RuntimeContractDigest string `json:"runtime_contract_digest"`
StartedAt time.Time `json:"started_at"`
LastSeenAt time.Time `json:"last_seen_at"`
Live bool `json:"live"`
Draining bool `json:"draining"`
Ready bool `json:"ready"`
}
type OperationError ¶
type OperationError struct {
Code string
}
func (*OperationError) Error ¶
func (e *OperationError) Error() string
type PreflightOptions ¶
type Report ¶
type Report struct {
DatabaseTime time.Time `json:"database_time"`
SchemaInstalled bool `json:"runtime_schema_installed"`
Control *Control `json:"control,omitempty"`
Current Current `json:"current"`
Members []Member `json:"members"`
Legacy *LegacyEvidence `json:"legacy,omitempty"`
Database DatabaseEvidence `json:"database"`
Retirement *RetirementEvidence `json:"retirement,omitempty"`
Readiness Readiness `json:"readiness"`
ReopenReadiness *Readiness `json:"reopen_readiness,omitempty"`
SignalBus SignalBus `json:"signal_bus"`
Changed bool `json:"changed,omitempty"`
RuntimeUninstalledNoop bool `json:"runtime_uninstalled_noop,omitempty"`
}
func (Report) MarshalJSON ¶
type RetirementEvidence ¶
type RetirementEvidence struct {
LiveWindowMilliseconds int64 `json:"live_window_ms"`
MembersBefore int64 `json:"members_before"`
LiveMembers int64 `json:"live_members"`
StaleMembers int64 `json:"stale_members"`
RetiredStaleMembers int64 `json:"retired_stale_members"`
MembersAfter int64 `json:"members_after"`
}
type RetirementOptions ¶
type RetirementOptions struct {
AllowRuntimeUninstalledNoop bool
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(pool *pgxpool.Pool, cfg ServiceConfig) *Service
func (*Service) HardMaintenance ¶
func (*Service) RetireStaleMembers ¶
RetireStaleMembers removes abandoned membership rows only after proving that this command is the sole database client and no member is still live. The follow-up migration preflight remains the authoritative exclusivity gate.
type ServiceConfig ¶
type ServiceConfig struct {
Identity Identity
SignalMode string
SignalHealth SignalHealth
LiveWindow time.Duration
}
type SignalHealth ¶
Click to show internal directories.
Click to hide internal directories.