fix(k1): settle same-process standby checkpoint
This commit is contained in:
@@ -2627,6 +2627,7 @@ def _require_gap_cessation_evidence_session(
|
||||
failed_binding: ActiveAcquisitionRecoveryTransportBinding,
|
||||
failed_evidence_session_id: str,
|
||||
status_proof: ActiveAcquisitionRecoveryStatusProof,
|
||||
allow_same_runtime_successor_evidence: bool = False,
|
||||
) -> None:
|
||||
crosses_runtime_instance = (
|
||||
status_proof.binding.runtime_instance_id
|
||||
@@ -2640,7 +2641,11 @@ def _require_gap_cessation_evidence_session(
|
||||
"terminal recovery across a runtime instance requires a successor "
|
||||
"evidence session"
|
||||
)
|
||||
if not crosses_runtime_instance and not preserves_evidence_session:
|
||||
if (
|
||||
not crosses_runtime_instance
|
||||
and not preserves_evidence_session
|
||||
and not allow_same_runtime_successor_evidence
|
||||
):
|
||||
raise ActiveAcquisitionRecoveryCheckpointTransitionError(
|
||||
"same-runtime terminal recovery must preserve the exact evidence session"
|
||||
)
|
||||
@@ -3316,16 +3321,26 @@ def _require_active_reconciled_standby_shape(
|
||||
raise ActiveAcquisitionRecoveryCheckpointTransitionError(
|
||||
"restart standby physical proof must advance the active lineage"
|
||||
)
|
||||
recovery_binding = cessation_status_proof.binding
|
||||
same_runtime = (
|
||||
recovery_binding.runtime_instance_id == failed_binding.runtime_instance_id
|
||||
)
|
||||
if (
|
||||
cessation_status_proof.binding.runtime_instance_id
|
||||
== failed_binding.runtime_instance_id
|
||||
or cessation_status_proof.binding.control_session_id
|
||||
== failed_binding.control_session_id
|
||||
recovery_binding.control_session_id == failed_binding.control_session_id
|
||||
or cessation_status_proof.evidence_session_id
|
||||
== failed_evidence_session_id
|
||||
or (
|
||||
same_runtime
|
||||
and (
|
||||
recovery_binding.host_path_epoch == failed_binding.host_path_epoch
|
||||
or recovery_binding.producer_generation
|
||||
== failed_binding.producer_generation
|
||||
)
|
||||
)
|
||||
):
|
||||
raise ActiveAcquisitionRecoveryCheckpointTransitionError(
|
||||
"restart standby settlement requires new runtime, control and evidence sessions"
|
||||
"standby settlement requires a new control/evidence boundary; "
|
||||
"same-runtime recovery also requires a new host path and producer generation"
|
||||
)
|
||||
|
||||
gap_started = _validated_timestamp(
|
||||
@@ -4982,6 +4997,9 @@ def _validate_checkpoint_semantics(
|
||||
prior_active_status.evidence_session_id
|
||||
),
|
||||
status_proof=status,
|
||||
allow_same_runtime_successor_evidence=(
|
||||
receipts[-1].kind == "cease-active-reconciled-standby"
|
||||
),
|
||||
)
|
||||
if receipts[-1].kind == "cease-active-reconciled-standby":
|
||||
gap_started_at_utc = checkpoint.last_gap_started_at_utc
|
||||
|
||||
Reference in New Issue
Block a user