Skip to content

mcp-data-platform-v1.146.1

Choose a tag to compare

@github-actions github-actions released this 16 Oct 17:04
· 109 commits to main since this release
4d35790

Scratch tables recover on their own, and webhook reads stay bounded when storage is slow

v1.146.1 fixes a failure seen in production on a Hive file metastore over slow object storage. A table registration that timed out after Trino had created the table left a table with no registration, and every later registration of the same file then failed with "already exists". A scheduled export that registers its output failed on every run until someone dropped the table by hand.

The same slow-storage conditions also made a busy webhook source's recent events expensive to read, and made retention list every raw segment on every pass. This release fixes both, and adds the administration tools to see and repair the scratch schema.

There are no migrations, and no configuration change is needed. See Upgrading from v1.146.0 for two defaults that changed.

Highlights

  • A table left by a timed-out registration no longer blocks the file. The next registration adopts it (#2131).
  • scratch.statement_timeout bounds the statements that create and drop scratch tables (#2131).
  • Webhook open windows are rolled up. A reader of recent events reads a few merged files, not one object per segment (#2132).
  • Segment pressure is reported, and a save whose settings imply too many segments is warned (#2132).
  • Retention adds and removes raw partitions by name, and the full listing is an admin action (#2133).
  • Raw segments are kept one day after compaction by default, and a save warns when metastore reads are slow (#2134).
  • failing_automations says whether a newer run is under way (#2135).
  • Scratch Tables > Reconcile lists tables with no registration, registrations whose table is gone and tables reading somewhere else, and repairs the ones the platform can prove are its own (#2136).

Upgrading from v1.146.0

  • Raw retention default. A webhook source created from this release without raw_retention_days keeps raw segments for 1 day after its window is compacted, down from 7. Sources created before keep the value they were stored with; 7 unless set otherwise. A compacted window's events are all in its Parquet file, and a recompaction reads that file, so lowering an existing source to 1 loses nothing.
  • Open windows are rolled up. Every source, including existing ones, now has its open window's segments merged every 5 minutes (rollup_every_minutes). The merged segments are deleted at least 2 minutes after each rollup. Until then, the raw side of the view returns those events twice, as it already returns a sender's retries; the compacted side and the view after compaction are unchanged.
  • Retention no longer runs sync_partition_metadata ... 'FULL'. An operator who relied on retention to repair raw partitions after a restore uses Resync partitions (POST /api/v1/admin/webhooks/sources/{name}/sync-partitions) instead.
  • Set metastore caching on a file-metastore scratch catalog. hive.metastore-cache-ttl=10m and hive.metastore-refresh-interval=1m are now documented as required for webhook sources and table registration on a Hive file metastore. Without them, partition calls and registrations time out whenever object storage is slow. Trino reads catalog properties at startup, so restart the coordinator and every worker after setting them.
  • Admin errors from the query engine on the new routes answer 503 with the engine's message.

Table registration

A table a timed-out registration left is adopted (#2131)

  • What happened. A CREATE TABLE that failed on the platform's side (its deadline passed, or the caller went away) could still be completed by Trino, leaving a table with no registration. The next registration of the file then issued a bare CREATE TABLE and was refused "already exists", and so was every one after it.
  • Now, when the name is held by a table nothing registered:
    • the registration reads that table's external_location;
    • if it lies under the directory the file keeps every version under (resources/{scope}/{owner}/{id}/ for a managed resource, {prefix}/{owner}/{id}/ for an asset), the table can only be left over from this file, and is dropped, created again and recorded;
    • a table reading anything else is refused, naming where it reads: ... already exists in the scratch schema and no registration holds it; it reads s3://..., not this file; choose another table name.
  • After an abandoned CREATE. The registration drops the table it may have made, under the same check, and audits the drop. This only narrows the window, because Trino may commit the CREATE afterwards; the adoption above is what guarantees the next registration succeeds.
  • Two registrations of one file at once. When one adopts and records the name first, the other fails without dropping the table the first now owns.

scratch.statement_timeout (#2131)

toolkits:
  trino:
    instances:
      scratch:
        scratch:
          catalog: scratch
          schema: uploads
          statement_timeout: 10m   # a duration, or a number of seconds

It bounds each statement the platform runs in the scratch target: a registration, a follow, and a webhook source's tables and partitions. Unset, the connection's timeout applies (120 s by default). A value that does not parse refuses the connection, at startup and when a connection is added through the admin API.

Reconciling the scratch schema (#2136)

  • Scratch Tables > Reconcile (administrators). Pick a connection and see three lists:
    • Tables with no registration, each with the location it reads and the file that location belongs to;
    • Registrations whose table is gone;
    • Tables reading somewhere else.
  • Repair selected.
    • A table with no registration whose location is a file the platform stores is dropped.
    • A registration whose table is gone is removed.
    • Each repair is proved again as it is made, audited under the administrator, and reported with its reason when it cannot be made.
    • A table over anything else reads Not the platform's; left alone and cannot be selected.
    • A webhook source's tables are removed only with the source.
  • Routes.
    • GET /api/v1/admin/tables/registrations lists every registration, filtered by connection, persona, source_kind and source_id, and q.
    • GET /api/v1/admin/tables/reconcile?connection= returns orphans, missing and drifted.
    • POST /api/v1/admin/tables/reconcile takes {"connection", "repair": [{"action": "drop", "table"} | {"action": "forget", "registration_id"}]}, at most 500 at once.

Inbound webhooks

The open window's rollup (#2132)

  • Why. A source's open window is read from its raw segments, one object each. One source at about 70 events per second, written by three replicas every 200 ms, wrote about 3,700 segments an hour. A count over such an hour took 130 s, against 20 s for the same hour compacted.
  • What happens.
    • Every rollup_every_minutes (default 5), one replica merges the segments written into the open window since the last rollup into one rollup-{time}.jsonl.gz in the window's directory. The raw table reads it like any segment.
    • A hidden manifest beside it names what was merged, and the merged segments are deleted at least webhooks.compactor.rollup_delete_delay (2m) later, so a query that already listed them still reads them.
    • A rollup is never merged again, so a reader of an hour's window reads at most twelve rollups plus the newest segments.
    • Only the open window is rolled up. A window that ends before a rollup's segments could be deleted is not rolled up; with the defaults, that is a compact_every_minutes of 2 or less.
  • Pacing. webhooks.compactor.rollup_check_every (1m) is how often open windows are checked.

Segment pressure and save warnings (#2132, #2134)

  • New fields. segments_open_window and segments_per_window_p95 (the 95th percentile per window over the last day) are on GET /api/v1/admin/webhooks/status and on a source's own status. Admin > Webhooks shows Raw files (current window), and a source's page shows both figures.
  • Warnings on save. A create or change of a source answers with warnings, never a refusal, when:
    • its settings imply more than 1,000 segments between rollups: rollup_every_minutes over flush_max_interval_ms, times the replicas receiving;
    • a timed read of the raw table's $partitions takes 5 s or more, or fails. The save waits for it at most 15 s.
  • In the portal. The editor shows Saved, with warnings before opening the source.

Retention by name (#2133)

  • Every retention pass:
    • registers the raw partition of each window a segment landed in during the last two retention intervals;
    • unregisters the raw partition of each window whose segments it deleted.
  • Cost. It no longer lists the raw table's whole location, so a pass costs the windows that changed, not every segment raw retention keeps.
  • The full listing is Resync partitions on a source's page, and POST /api/v1/admin/webhooks/sources/{name}/sync-partitions.

Defaults (#2134)

  • raw_retention_days defaults to 1; see Upgrading from v1.146.0.
  • The editor gains Merge recent raw files every (minutes).

Automations

failing_automations names the newest run (#2135)

Each entry platform_info returns in failing_automations carries two new fields:

  • latest_run: {run_id, status, started_at}, the automation's newest run whatever its status;
  • superseded_by_running: true while a run newer than the failed one is pending or running.

A monitor or an agent can hold off while a recovery run is under way, rather than acting on a failure that run may already have fixed, such as recommending a drop of the table it just registered.

Documentation

Known issue: the documentation site has not deployed since v1.146.0's catalog changes, because the site build fails on a menu entry for a removed page (#2138). Until that is fixed, the published pages show older content; the repository's docs/ directory is current.

Changelog

Bug Fixes

Closes #2131, #2132, #2133, #2134, #2135, #2136.

Installation

Homebrew (macOS)

brew install txn2/tap/mcp-data-platform

Claude Code CLI

claude mcp add mcp-data-platform -- mcp-data-platform

Docker

docker pull ghcr.io/txn2/mcp-data-platform:v1.146.1

Verification

All release artifacts are signed with Cosign. Verify with:

cosign verify-blob --bundle mcp-data-platform_1.146.1_linux_amd64.tar.gz.sigstore.json \
  mcp-data-platform_1.146.1_linux_amd64.tar.gz

Archives and checksums also carry GitHub artifact attestations. Verify with:

gh attestation verify mcp-data-platform_1.146.1_linux_amd64.tar.gz \
  --repo txn2/mcp-data-platform