Schedule icon
Query icon
Return icon
Switch icon
SlackIncomingWebhook icon
If icon
Loop icon
Log icon

StarRocks Routine Load Ingestion Stall & Auto-Resume Sentinel

Audit StarRocks Routine Load ingestion states for paused tasks, route failure alerts to Slack, and safely auto-resume stalled streaming pipelines.

Categories
Data

StarRocks is a high-performance distributed real-time analytical database widely used for sub-second OLAP queries over massive datasets. Routine Load is StarRocks native continuous ingestion mechanism for streaming platforms like Apache Kafka and Apache Pulsar. Under production workloads, transient data quality anomalies, unparseable payloads exceeding error thresholds, or network partitions cause StarRocks to transition Routine Load jobs into a PAUSED state. Once paused, consumption halts entirely, consumer lag compounds silently, and analytical dashboards drift out of sync until manual administrative intervention occurs. This blueprint provides an automated sentinel that continuously audits Routine Load health, alerts engineering teams before SLAs breach, and executes safe, guarded auto-resumption when enabled.

How it works

  1. Scheduled trigger (every_fifteen_minutes) initiates the diagnostic workflow every 15 minutes, with manual on-demand execution supported via inputs.
  2. Probe task (probe_routine_loads) connects to the StarRocks Frontend (FE) query port via the MySQL protocol (io.kestra.plugin.jdbc.mysql.Query) and inspects information_schema.routine_load_jobs for jobs in PAUSED, UNSTABLE, or CANCELLED states.
  3. Classification step (classify_status) evaluates the query results using Pebble conditionals, grouping the operational state into HEALTHY, WARNING, CRITICAL, or PROBE_FAILED.
  4. Flow router (route_by_status) switches downstream execution based on the classified health tier.
  5. On CRITICAL state, alert_critical_slack dispatches an incident notification to the configured Slack channel with detailed error reasons and job identifiers.
  6. Guarded remediation (check_remediation) checks whether auto_resume is enabled and dry_run is disabled. If confirmed, resume_stalled_jobs iterates over affected jobs and executes RESUME ROUTINE LOAD FOR db.job via MySQL query tasks.
  7. On PROBE_FAILED or unexpected errors, dedicated Slack alerting tasks notify administrators of infrastructure connectivity loss.
  8. Final audit task (log_audit_summary) outputs a structured execution record detailing the evaluated status, job count, and execution lineage.

What you get

  • Automated continuous detection of paused, stalled, or cancelled streaming ingestion pipelines across all StarRocks databases.
  • Incident alerts delivered to Slack with exact database, table, job names, and root-cause state change reasons.
  • Safe, guarded auto-remediation that resumes transiently stalled Routine Loads while strictly honoring dry-run safeguards.
  • Hardened execution handling with flow-level error traps preventing silent monitoring failures.
  • Immutable execution logs in Kestra providing historical audit trails of all ingestion stalls and recovery events.

Who it's for

  • Data Platform Engineers operating mission-critical StarRocks analytical warehouses.
  • Streaming & Real-time Analytics Teams managing high-throughput Kafka-to-StarRocks pipelines.
  • Site Reliability Engineers (SREs) enforcing data freshness SLAs and ingestion uptime.

Why orchestrate this with Kestra

  • Declarative YAML specification eliminates ad-hoc shell scripts, unmonitored crontabs, and unversioned database maintenance routines.
  • Native MySQL JDBC plugin connectivity eliminates custom Python worker container dependencies and credentials leakage.
  • Built-in conditional flow routing seamlessly separates observation, alerting, dry-run validation, and remediation into auditable stages.
  • Centralized credential handling keeps database passwords securely masked in execution logs and UI traces.
  • Full execution timeline and state history provide complete visibility into pipeline drift and resolution history.

Prerequisites

  • StarRocks cluster (v2.5+ or v3.0+) accessible over MySQL client protocol (default port 9030 on FE node).
  • Database user with SELECT privilege on information_schema.routine_load_jobs and INSERT privilege on target tables for RESUME ROUTINE LOAD.
  • Slack incoming webhook URL for notifications.

Secrets

  • STARROCKS_USERNAME: Username for authenticating to the StarRocks FE MySQL query port.
  • STARROCKS_PASSWORD: Password for the StarRocks database user.
  • SLACK_WEBHOOK_URL: HTTPS incoming webhook URL for the target Slack channel.

Quick start

  1. Configure STARROCKS_USERNAME, STARROCKS_PASSWORD, and SLACK_WEBHOOK_URL in your Kestra namespace secrets.
  2. Deploy this flow to your Kestra instance and execute an initial manual run with dry_run: true to verify connectivity against your StarRocks Frontend.
  3. Review the execution logs in the Kestra UI to confirm Routine Load jobs are queried successfully.
  4. Enable the every_fifteen_minutes schedule trigger to establish continuous automated monitoring.

How to extend

  • Add Kafka consumer group lag checks via io.kestra.plugin.kafka to correlate Routine Load pauses with upstream partition backlogs.
  • Integrate PagerDuty alerting via io.kestra.plugin.pagerduty.notifications.PagerDutyAlert for high-priority production warehouse outages.
  • Attach downstream dbt or materialized view refresh triggers once ingestion recovery is confirmed.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.