Skip to content

v1.4.11

Choose a tag to compare

@jghoman jghoman released this 17 Nov 19:45
· 59 commits to main since this release
2390b27

Server, pyhoglake, millrace and webui release.

  • Atomic partition replacement. A new commit route ends whole live data files of a table and appends their replacements in one snapshot. The changefeed records it as table_replaced.
  • Auth wave 2. The server now has a session-profile token contract, off by default. Every catalog store a handler gets is checked against the token and bound to it. Route values are read from the path only.
  • Remote schemas, Client side. A namespace name can be served read-only from another hoglake deployment, optionally under a local alias.
  • Hoglite maintenance. Manual compaction now runs through the executor PostgreSQL uses, and per-catalog maintenance status and run history work on hoglite.
  • Migrations: V36 (V36__replacement_changes.sql). It widens the hog_snapshot_change.kind CHECK and adds hog_commit_receipt.ended_files. Details are under Operators.
  • Upgrading: no config change is needed, and every new setting defaults to off. Before rolling out, check the caveats under Operators:
    • V36 holds an ACCESS EXCLUSIVE lock on hog_snapshot_change while it validates;
    • with the default HOGLAKE_AUTH_SESSION_PROFILE=off, a token that carries a session-profile claim is now refused;
    • a handler can no longer reach a catalog or namespace the token does not grant, and under warn a scoped caller is refused for this;
    • a query parameter named like a route value is no longer read or relayed.

Server

  • Atomic partition replacement (#571, #631):
    • POST /v1/catalogs/{catalog}/commit/replacements/prepared, advertised as the new capability atomic-partition-replacement-v1. A server that does not support it answers 404, so it never ignores file_ends and publishes only the appends.
    • The body is a CommitRequest plus file_ends (new schema TableFileEnds). Each entry gives namespace, table, a required expected_table_uuid, and exactly one of partitions (tuples in the partition_values encoding) or all_files: true.
      • A year, month, day, hour or bucket value must be a base-10 integer string (20401, not 2025-11-10); anything else is a 422.
      • A tuple that matches no live file ends nothing and is not an error. A table may appear in only one entry.
    • Required fields: idempotency_key, read_snapshot, author and message. deletes or require_unchanged_tables: true is a 400. appends may be empty.
    • Under the commit lock the server checks, in order:
      • the table incarnation (409 table_recreated);
      • the conflict window;
      • the partition spec (409 partition_spec_mismatch while a live file has another spec; all_files is exempt).
    • It then ends each matching live file together with its live deletion vector, and applies the appends.
    • Conflict window:
      • all_files: the table must be unchanged since read_snapshot.
      • partitions: only the target tuples must be unchanged. Any DDL on the table also conflicts, but appends to other partitions do not.
      • Compaction never conflicts. A compaction group planned against an ended file skips that file.
    • Files appended by the same request are never ended by it. An appended path that the catalog already records, live or ended, is a 422.
    • Nothing is deleted at commit. Ended files go through normal retention, expiry and cleanup.
    • CommitResult and GET /commit/receipts/{operation} gain ended_files, which is also returned on replay. It is omitted on other endpoints and on receipts written before V36.
    • Change kind table_replaced: recorded beside table_deleted_from when a replacement ended at least one file of the table. changes() answers 409 reconciliation_required for a window that crosses one, as it does for a truncate. The barrier sits on the change row, so it holds at the retention floor as well.
    • Implemented on PostgreSQL and hoglite. The existing commit routes reject file_ends.
    • Containment order fix (#631): on PostgreSQL, the recorded-path check now runs after the namespace containment checks. A path under another contained namespace is refused with containment_violation, whether or not that path is recorded. Hoglite already checked in this order.
  • Session profile (#622):
    • The profile's contract is in docs/auth.md ("Session profile with embedded storage credentials"). It is PROPOSED and experimental.
    • Its claims are profile, version, purpose, primary_catalog, remote_schemas (read only, at most 16) and aws (an STS-shaped credential, with exp ≤ aws.expires_at). sid, generation, session_deadline and grants are optional.
    • The server only validates the shape, records remote_schemas and forwards the bytes. It never uses the credentials.
    • New HOGLAKE_AUTH_SESSION_PROFILE=off|on (default off). Any other value fails boot.
      • With off, a token that carries profile, aws, primary_catalog or remote_schemas is refused with the new reason profile_not_enabled. It is no longer read as a plain metadata token.
      • With on, the profile is validated, and an operator token may not carry it.
    • New metric hoglake_auth_session_profile_total{outcome="accepted"|"refused_disabled"|"refused_invalid"}.
    • Contract vectors: contract-vectors.json gains tenant_session_profile_disabled. The new file session-profile-vectors.json holds the profile's vectors; all are mutation vectors until an issuer mints the profile.
  • Store entitlement (#627, #629):
    • CatalogStoreSelector applies the auth plugin's catalog and scope check to whatever catalog name the handler passes it. Refusals:
      • 404 worded as a missing catalog;
      • 403 for a missing scope;
      • 401 with no caller.
    • Modes follow the plugin:
      • off checks nothing;
      • warn counts, audits and lets the request through, except for a scoped caller, which is refused as under enforce.
    • Each request adds at most one refusal to hoglake_auth_requests_total. The audit line carries at=store. There is no new label.
    • The handler now gets a per-request view of the catalog store and of each sub-backend, bound to the token (#629):
      • every caller: any catalog other than the resolved one is refused;
      • scoped callers: any namespace the token does not allow is refused, whether it comes from the path, the body or an id (table creations, file ids, lookup cursors);
      • scoped callers: operations that name no namespace are refused, except renewing and abandoning the caller's own upload claims.
    • A disallowed namespace answers the 404 of a missing namespace. An id that belongs to one answers the 404 of a missing id. A scoped table-creation status read in a disallowed namespace now answers 404 for the operation.
    • The namespace gate, the scoped-write checks and the listing filter are unchanged and still decide first. A consistent request costs no extra lookup.
    • Not covered: /v1/maintenance/status, /v1/maintenance/runs, /v1/database/health and GET /v1/mounts. The route table refuses scoped callers on these. docs/auth-tenancy.md lists them.
  • Path-only route values (#625):
    • Handlers read {catalog}, {namespace}, {table}, {operation}, {upload} and the other route values from the matched path only, as the route table and gates do. Before this, they read them from merged parameters that included the query string.
    • The mount relay (MountHostClient) no longer forwards a query parameter named catalog, namespace or table, in any letter case.
    • Documented query parameters are unchanged.
  • Remote schemas (#628, #630):
    • A HOGLAKE_MOUNT_HOSTS_FILE entry with "match": {"type": "namespace", "name": NAME} serves the namespace NAME of every catalog on this server read-only, relayed to another hoglake (the Host). kind must be hoglake and auth must be forward.
    • Access:
      • Served only to a scoped caller whose token grants read on the catalog and whose remote_schemas claim allows the schema. The catalog must exist locally.
      • Anyone else gets the 404 of a missing namespace, and nothing is sent to the Host.
    • Relayed routes: get namespace, list tables, get table and scan, with the caller's Authorization header. Every other route on the schema answers 501 mount_operation_unavailable for a read and 403 read_only_catalog for a write.
    • GET …/namespaces adds {"name", "remote": true} for each schema the token allows, without calling the Host. On the wire, Namespace.namespace_id is now optional: it is absent exactly when remote is true. A local entry is unchanged.
    • NAME is reserved (it is added to the reserved namespaces). A local namespace with that name, or a case variant of it, is hidden from every path, body, id, query parameter and upload prefix, but not removed.
    • Boot refuses a namespace entry in these cases:
      • HOGLAKE_AUTH_SESSION_PROFILE is not on;
      • its URL is not https and the entry does not set "allow_insecure_http": true. An entry that opts in is logged.
    • Alias (#630): an entry-level "remote_name" sets the schema's name on the Host (default NAME).
      • The remote_schemas claim and the relayed path use remote_name.
      • The answers' name and the table's namespace are rewritten back to NAME within max_response_bytes.
      • Two namespace entries with the same Host name are refused at boot.
      • An aliased answer refused after its first bytes are sent is cut mid-transfer.
    • allow_insecure_http and remote_name are refused on events and catalog entries. A server with no namespace entry behaves as before.
    • The Host side is not built.
  • Hoglite maintenance (#623, #624, #626):
    • #623 extracts CompactionExecutor and a CompactionStorage seam from CompactionService. PostgreSQL behaviour is unchanged.
    • POST …/maintenance/compact now works on hoglite through the same executor (#624):
      • the executor owns VARIANT layout handling, budgets and accounting;
      • the hoglite adapter reserves claims per input, reads at most candidateBudget candidates per table, and publishes behind guards.
      • It stays manual; there is no loop, registry or lease.
    • GET …/maintenance/status and the per-catalog run history now work on hoglite, from one read-only snapshot, paged by an indexed cursor of at most 500 rows (#626). Fleet status, fleet runs and database health remain PostgreSQL-only, and answer 501 not_supported_on_backend when no PostgreSQL backend is configured.
    • New hoglite tenant DDL, created at tenant bootstrap:
      • files_compaction_bucket, files_live_stats, files_live_size, removals_queued_at and maintenance_runs_loop;
      • the receipt_ended table, which a replacement creates if it is missing.
  • OpenAPI: the version is 1.4.11. Additions:
    • commitPreparedReplacement and TableFileEnds;
    • ended_files on CommitResult and on the receipt;
    • table_replaced in the change kinds;
    • Namespace.remote, with namespace_id now optional.

pyhoglake / hedgerow

  • The variant-codec extra now pins pyhoglake-variant-codec==0.1.1 (#638).
  • Variant codec 0.1.1 (#632): pyo3-arrow 0.21 on arrow 60.1 (was arrow 59.3), with no source changes. Encoded VARIANT bytes are unchanged, and PROTOCOL stays 3.
  • The pyarrow floor is now >=26.0.1 (#570).
  • The write golden test ignores only the parquet footer's created_by stamp (#633).
  • hedgerow: the COPY test fixtures bind parameters by name, so they pass on duckdb 1.5.6 and 2.0.0 (#639). Production code is unchanged.

millrace

  • slatedb==0.18.* (was 0.17) (#636), and pyarrow>=26.0.1 (#570).
  • mutmut 3.8.1, for pytest 9.2 (#633). The mutation ledger records 286 mutants, 268 killed and 18 survived.

webui

CI / docs

  • Tests:
    • #633 unblocks #570 (pytest 9.2, pyarrow 26.0.1).
    • #639 unblocks the duckdb 2.0 bump (#505).
    • New soak test NamespaceFieldRewriteFuzzTest (#630).
  • Docs:
    • docs/auth-roadmap.md Phase 3 is reconciled with the hogtower architecture specs, and AGENT.md gains a cross-repo specs section (#621).
    • docs/auth-tenancy.md covers the store check and remote schemas (#627–#630).
    • docs/operational-notes.md gains a "Maintenance scheduling" section (#624).
    • Dev versions were restored after 1.4.10 (#616).
  • Dependencies:
    • JVM: AWS SDK 2.57.12, Jackson 2.23.0 and kotlin-logging 8.0.6 (#620, #635);
    • Python: pyarrow 26.0.1 (#570), slatedb 0.18.1 (#636) and psycopg[binary]>=3.3.8 (#637);
    • webui npm: minor/patch group and jsdom 31 (#617, #618, #634).

Operators

  • Migration V36 (PostgreSQL, #571):
    • It runs in one transaction with SET LOCAL lock_timeout = '5s', which bounds the wait for each lock. On timeout the whole file rolls back and Flyway fails; retry it when traffic is quieter.
    • Steps:
      1. DROP CONSTRAINT hog_snapshot_change_kind_check takes ACCESS EXCLUSIVE on hog_snapshot_change.
      2. ADD … NOT VALID with table_replaced added to the kinds.
      3. VALIDATE CONSTRAINT.
    • The VALIDATE runs under the DROP's ACCESS EXCLUSIVE lock, which is held until commit. The usual NOT VALID/VALIDATE split does not avoid blocking here, so commits and reads of hog_snapshot_change wait for the full scan.
    • Expiry keeps hog_snapshot_change bounded to the retention window, so on a catalog with normal retention the scan is short. Catalogs whose expiry has fallen behind will hold the lock for longer.
    • ALTER TABLE hog_commit_receipt ADD COLUMN ended_files bigint is metadata-only (NULL default, no rewrite), but also takes ACCESS EXCLUSIVE.
    • Hoglite tenants need no migration.
  • Defaults:
    • HOGLAKE_AUTH_SESSION_PROFILE=off.
    • A mount-hosts file without a namespace entry behaves as before.
    • HOGLAKE_AUTH_MODE still defaults to off, and with it the store checks of #627 and #629 do nothing.
  • Token acceptance change (#622): with the default off, a token that carries profile, aws, primary_catalog or remote_schemas is now refused (profile_not_enabled). These claims used to be ignored. Check that no issuer adds them before you upgrade, or set HOGLAKE_AUTH_SESSION_PROFILE=on.
  • Store entitlement (#627, #629):
    • Under enforce or local, a handler that reached a catalog the token does not name, or (for scoped callers) a namespace the token does not allow, is now refused with 404/403.
    • Under warn, these refusals are counted and audited with at=store, and only scoped callers are refused.
    • Watch hoglake_auth_requests_total and the audit log for at=store after the upgrade.
  • Path-only route values (#625): a client that put catalog, namespace or table in the query string and relied on it overriding the path now gets the path's value. The mount relay drops such parameters.
  • Remote schemas (#628, #630):
    • Configuring one needs HOGLAKE_AUTH_SESSION_PROFILE=on and an https URL, unless the entry sets allow_insecure_http.
    • A local namespace with the schema's local name becomes invisible to clients. It is not removed, and catalog-wide storage usage and maintenance still include it.
    • One concurrency limit per Host is shared by all catalogs.
  • Hoglite tenants (#624, #626): the new indexes are created at tenant bootstrap. On older tenants:
    • status reports unknown backlog counts, while ledger reads still work;
    • a compaction plan uses one capped fallback read, which can scan and sort the live candidates.
    • A GET never upgrades a tenant schema. Recreate development tenants to get the indexes.