Odoo Scheduled Action Overdue Sentinel
Read-only count overdue Odoo scheduled actions (ir.cron) via XML-RPC on a schedule and page Slack when the background job runner looks stuck or dead.
Detect Vertica projections nearing the 1024 ROS container pushback limit, alert Slack, run mergeout to consolidate them then re-count to prove the drop.
Vertica writes every COPY, INSERT and moveout as a new ROS container on disk. A projection fed by trickle loads ends up with hundreds of small containers. A query has to open all of them, so scans keep getting slower. Vertica caps a projection at 1024 ROS containers per node. That cap is ROS pushback. Once it is reached new loads to the projection are rejected until the Tuple Mover merges containers down.
This guard reads v_monitor.projection_storage, which carries ros_count, the number of ROS containers in each projection per node. It flags the projections over a threshold you set and alerts Slack. When you let it, it runs DO_TM_TASK('mergeout', ...) on each flagged projection one at a time. Mergeout runs the strata algorithm to merge the small containers into fewer large ones. The guard then polls the count back down and fails the run if any projection is still over the threshold.
This blueprint was created by zkasuran.
| Finding | Meaning |
|---|---|
| ROS containers over threshold | A projection holds more ROS containers on a node than ros_container_threshold. Every scan opens all of them, so the projection slows down. At 1024 per node new loads start failing with ROS pushback. |
Mergeout consolidates ROS containers. It is not a purge. It does not reclaim the space held by deleted rows, which is a separate concern driven by delete vectors and PURGE. The guard stays read-only until auto_remediate is true and dry_run is false. The mergeout loop runs one projection at a time, since each mergeout locks its projection. Mergeout is synchronous on a single node and asynchronous on a cluster, so the re-count is polled up to verify_timeout and then read once more as a hard gate, so a mergeout that did not land fails the run.
audit (io.kestra.plugin.jdbc.vertica.Query, read-only) reads v_monitor.projection_storage, keeps the projections whose ros_count is over ros_container_threshold and builds a DO_TM_TASK('mergeout', ...) statement for each one.mergeouts keeps the distinct mergeout statements, since a projection reports one row per node. summary logs the flagged projections with their container and row counts.route (io.kestra.plugin.core.flow.If) branches on whether anything was flagged.alert posts to Slack. remediate_gate runs only when auto_remediate is true and dry_run is false.remediate (io.kestra.plugin.core.flow.Loop, concurrencyLimit: 1) runs each mergeout in turn.wait_for_merge (io.kestra.plugin.core.flow.LoopUntil) polls the count until every flagged projection is back under the threshold, bounded by verify_timeout.reaudit and verify_result read the counts once more and fail the run if any projection is still over the threshold.errors posts a Slack alert when any task fails.auto_remediate true and dry_run false.Vertica merges containers on its own through the Tuple Mover, but that can lag behind a projection under constant trickle loads. By the time pushback hits, loads are already failing. Running mergeout on demand means reading the container counts, picking the projections over the line, merging them one at a time, waiting for an asynchronous mergeout on a cluster and failing loudly when one did not land. Kestra runs that on a schedule, keeps the write behind two inputs, merges one projection at a time, verifies the result and keeps a history of every run.
On Kestra 2.0.5 OSS against Vertica Community Edition 9.2 (database docker, schema analytics), with the shared HTTP sink standing in for Slack. A table analytics.events was loaded through many single-row direct inserts so its super projection accumulated ROS containers, with background mergeout turned off for the test. v_monitor.projection_storage.ros_count was read directly before and after each run.
| Run | Inputs | Result |
|---|---|---|
| 1 | clean, threshold 100000 | SUCCESS (6LdH4otMNvaPsYRHLmMIlZ). audit returned 0 projections. Clean path logged |
| 2 | degraded, threshold 10, dry_run true | SUCCESS (2x88LaPwQgUndJjnsT6sLT). 1 projection flagged (analytics.events events_super, 61 containers, 250 rows). Slack alert sent. ros_count stayed at 61 |
| 3 | threshold 10, auto_remediate true, dry_run true | SUCCESS (1DXzBfJdBbklp5QLbnkAMH). Same report. dry_run held the mergeout back, so ros_count stayed at 61 |
| 4 | threshold 10, auto_remediate true, dry_run false | SUCCESS (3rkthC4xqpstpLkzSMWoP8). mergeout on events_super. The re-count came back clean. ros_count went 61 to 1, confirmed in vsql |
| 5 | threshold 10, dry_run true, after run 4 | SUCCESS (6ZRJ8ccfpwYPtBDMRF7VTq). 0 projections flagged at the same threshold that flagged 61 before. The detector flipped from drift to clean |
| 6 | threshold 0, auto_remediate true, dry_run false, verify_timeout PT15S | FAILED (2Jz88dwct4zcXm07OdpX79). mergeout ran (31 to 1), but the re-count still found 1 container over the impossible 0 threshold, so verify_result failed the run. The errors block alerted Slack |
| 7 | unreachable database | FAILED (E5Dkc1Vr9xbrYOiVr0nRE). audit could not connect, so the errors block posted the failure alert to Slack |
Run 2 against run 5 is the proof the detector can fail: the same threshold of 10 reported drift at 61 containers and clean at 1. Run 6 is the proof the verify gate can fail: mergeout genuinely consolidated 31 containers to 1, but an impossible threshold kept the re-count over the line, so the run failed instead of reporting success.
jdbc_url.v_monitor.projection_storage. For remediation, a user allowed to run DO_TM_TASK('mergeout', ...) on the flagged projections, which means owning them or being a superuser.docker run -d --name vertica jbfavre/vertica:latest brings up a single node with database docker and user dbadmin.VERTICA_PASSWORD: password for the Vertica user. The password input defaults to it.SLACK_WEBHOOK_URL: used by alert and the errors block.SECRET_.| Input | Default | Purpose |
|---|---|---|
jdbc_url |
jdbc:vertica://vertica:5433/VMart |
Vertica cluster to check |
username |
dbadmin |
Vertica user |
password |
{{ secret('VERTICA_PASSWORD') }} |
Password for that user |
ros_container_threshold |
700 |
Flag a projection over this many ROS containers per node |
auto_remediate |
false |
Allow mergeout to run |
dry_run |
true |
Must be false for mergeout to run |
verify_timeout |
PT5M |
How long to wait for the count to drop after mergeout |
VERTICA_PASSWORD and SLACK_WEBHOOK_URL secrets.jdbc_url, username and ros_container_threshold.auto_remediate: true and dry_run: false.daily trigger, which always runs in safe mode.ros_container_threshold on projections where scan latency matters more than merge cost.DO_TM_TASK('mergeout', ...) for PURGE_PROJECTION when the goal is reclaiming deleted-row space rather than merging containers.