class ExecuteMaintenanceJob
Runs a single step of a maintenance execution and enqueues the next one, chaining through the materialised plan until every step has finished.
Constants
- MAX_RETRIES
- RETRY_WAIT
Public Instance Methods
# File app/jobs/execute_maintenance_job.rb, line 14 def perform(execution_history_id) execution = ExecutionHistory.find(execution_history_id) unless execution.status == "running" retry_pending(execution, execution_history_id) return end if execution.metadata_before.nil? execution.update!(metadata_before: execution.iceberg_table.metadata_snapshot) end # retry_count on the execution counts pending-dispatch retries only (step # retries live on ExecutionStep). Once the dispatch is visible those are # spent, so clear the budget - otherwise a healthy execution kept rendering # as "retrying" for the rest of the chain. execution.update!(retry_count: 0) if execution.retry_count.positive? step = next_step_for(execution) return finish_chain(execution) if step.nil? run_step(execution, step) end
Runs ONE step and enqueues the next. The engine is NOT brought down between steps - the TrinoEngineSupervisor owns that. The chain was materialised by run_plan with each stepβs cadence already resolved; order is always maintenance_steps.position. @param execution_history_id [Integer] the id of the execution being worked through.