fix(agent): use indexed replay terminal joins
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 2m41s
CD Pipeline / build-and-deploy (push) Failing after 12m30s
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
ogt
2026-07-14 14:42:40 +08:00
parent 04e7394b10
commit b7b127406c
4 changed files with 24 additions and 9 deletions

View File

@@ -187,8 +187,13 @@ def verified_ansible_candidate_terminal_sql(candidate_alias: str) -> str:
AND replay_check.status IN ('success', 'failed')
AND replay_check.input ->> 'execution_mode'
= 'stdin_boundary_check_mode_replay'
AND replay_check.input ->> 'replay_of_check_mode_op_id'
= failed_check.op_id::text
AND failed_check.op_id = CAST(
NULLIF(
replay_check.input
->> 'replay_of_check_mode_op_id',
''
) AS uuid
)
JOIN automation_operation_log terminal
ON terminal.parent_op_id = replay_check.op_id
AND terminal.operation_type = 'ansible_execution_skipped'
@@ -207,8 +212,6 @@ def verified_ansible_candidate_terminal_sql(candidate_alias: str) -> str:
) = __INCIDENT_ID__
AND replay_check.input ->> 'automation_run_id'
= __AUTOMATION_RUN_ID__
AND replay_check.input ->> 'replay_of_check_mode_op_id'
= failed_check.op_id::text
AND coalesce(
replay_check.incident_id::text,
replay_check.input ->> 'incident_id'

View File

@@ -4031,8 +4031,12 @@ async def _load_missing_stdin_boundary_terminal_projection_rows(
AND replay.input ->> 'automation_run_id'
= terminal.input ->> 'automation_run_id'
JOIN automation_operation_log failed_check
ON failed_check.op_id::text
= replay.input ->> 'replay_of_check_mode_op_id'
ON failed_check.op_id = CAST(
NULLIF(
replay.input ->> 'replay_of_check_mode_op_id',
''
) AS uuid
)
AND failed_check.operation_type
= 'ansible_check_mode_executed'
AND failed_check.status = 'failed'
@@ -4341,9 +4345,13 @@ async def _verify_stdin_boundary_terminal_projection_readback(
AND replay.input ->> 'execution_mode'
= 'stdin_boundary_check_mode_replay'
JOIN automation_operation_log failed_check
ON failed_check.op_id::text
= replay.input
->> 'replay_of_check_mode_op_id'
ON failed_check.op_id = CAST(
NULLIF(
replay.input
->> 'replay_of_check_mode_op_id',
''
) AS uuid
)
AND failed_check.operation_type
= 'ansible_check_mode_executed'
AND failed_check.status = 'failed'