Skip to content

v1.4.10

Choose a tag to compare

@jghoman jghoman released this 13 Nov 22:54
· 85 commits to main since this release
cec7d9f

Server, pyhoglake, millrace and webui release.

  • VARIANT shredding declarations can change. A new alter op, set_variant_shredding, replaces or clears a declaration. With HOGLAKE_COMPACTION_VARIANT on, compaction now rewrites a group of mixed VARIANT layouts per layout instead of refusing it.
  • Auth wave 1. hoglake owns its token contract and depends on no issuer. It accepts RS256 and the OAuth scope claim, can be its own issuer (HOGLAKE_AUTH_MODE=local), forwards verified JWTs to hoglite, and gets storage for its own jobs through a credential provider. millrace and the webui now present credentials.
  • Hoglite maintenance. Options, expiry, cleanup, manual requeue and retirement now run on hoglite. Each is manual and per catalog; none has a background loop.
  • Migrations: none. The newest migration is still V35.
  • Upgrading: an existing deployment needs no config change. Every new setting defaults to the previous behaviour. Before rolling out, check the caveats under Operators: the auth client metric label changes, an aud array with a non-string entry is now refused, a millrace pod with two credential sources set exits, and VARIANT compaction needs extra heap headroom.

Server

  • set_variant_shredding (#580):
    • {"op": "set_variant_shredding", "name": <column>, "shredding": <declaration> | null} on POST …/tables/{t}/alter, on PostgreSQL and hoglite. null or absent clears the declaration, and the column then has no type_params.
    • The declaration is validated as at create_table / add_column: grammar, 1000 fields and arrays, 1024 bytes of path names, depth 16, top-level variant only. A refusal is a 422 with the same messages.
    • A change commits a DDL snapshot. A writer holding an older read gets 409 ddl_since_read_snapshot and re-reads, then writes the new layout. The column keeps its field ID, and earlier snapshots still show the old declaration.
    • An equal declaration is a no-op: it writes no snapshot or row and refuses no in-flight writer. Equality ignores key order and number spelling, and a stored absent, {} or {"shredding": null} counts as no declaration. A request made only of no-ops answers 200 at the unmoved head, with the sampler's totals.
    • The declaration is a target for writers and compaction, not a rule on files. Files keep the layout their footer records.
    • New capability mutable-variant-shredding-v1. A server without it answers 400 unknown alter op.
  • VARIANT compaction by layout (#580, #614), with HOGLAKE_COMPACTION_VARIANT on. server/README.md's VARIANT compaction section has the details.
    • Per-layout split. A group whose inputs hold more than one VARIANT layout is no longer refused:
      • The service reads each input's footer once and hands it on to the rewrite, up to 16 MiB of serialized footer bytes per group.
      • It partitions the inputs by how their layouts deviate from the declaration. Each partition that still meets the group-size rule is rewritten in its own layout, the declared layout first.
      • Nothing is re-shredded: old-layout files compact among themselves.
      • DuckDB-written files are excluded on their own, and partitions too small to compact are left alone.
      • Only a field that is no VARIANT group, or one with a REPEATED node outside a LIST or MAP, still refuses its group as unconvertible_schema.
    • Catalog-scoped probe. The footer probe reads through the catalog's own storage session, as the rewrite does.
    • Layout memory. A per-process map from (catalog, data file) to the declaration and deviation fingerprints, capped at 250k entries. The planner packs known-deviating files only with files that deviate the same way, and drops known DuckDB files.
      • Compaction outputs are entered at commit.
      • DDL on the table, such as set_variant_shredding or adding, dropping or renaming a variant column, makes the table's entries stale, so each file is probed once more.
      • The map is empty after a restart.
    • Borrowing. A remembered remainder that is short of files can borrow idle never-probed files to complete a group:
      • one loan per bucket per sweep, at most minInputFiles − 1 files, prefixes only;
      • the search is bounded to the first fan-in of idle files and the eight largest stranded populations;
      • a loan is made only if every admitted main group keeps its files.
      • #614 lets a loan draw from main groups that the budget refuses, and counts a failed loan's file once.
    • Shape admission. Each deviating layout's shape (node count, nestedness, output leaves) is remembered, at most 4096 shapes, LRU.
      • A sorted group of that layout is admitted against the sorted budgets with its own shape, from metadata alone.
      • A layout the budgets refuse is probed once. After that it is refused from metadata as spill_budget_exceeded / merge_budget_exceeded.
      • Raising HOGLAKE_COMPACTION_SORTED_HEAP_BYTES / HOGLAKE_COMPACTION_SPILL_BYTES admits it on the next plan.
      • Chunk sizing and the re-admission of each part use that part's own layout.
    • Claims. A split group's claim is narrowed to the inputs it compacted, so files left behind can be planned again at once.
    • Run limit. A probe that rewrites nothing is charged against HOGLAKE_COMPACTION_MAX_GROUPS_PER_RUN. A group split into N parts uses N attempts, so the last wave of a sweep can overrun the limit by at most (layouts − 1) × HOGLAKE_COMPACTION_PARALLEL_GROUPS. Groups without VARIANT columns behave as before.
    • New ledger counter layout_probe_only, also in the CompactionResult API.
    • Metrics:
      • hoglake_compaction_variant_layout_mismatch_total{reason="split"|"duckdb"|"layout"}. split is expected for as long as old-layout files remain after a declaration change.
      • hoglake_compaction_variant_layout_outputs_total{layout="declared"|"other"}.
      • hoglake_compaction_variant_layout_files_left_total.
      • hoglake_compaction_skipped_total{reason="layout_probe_only"}.
    • The docs now map the ledger's spill_budget_exceeded / merge_budget_exceeded to hoglake_compaction_skipped_total{reason="spill_budget"|"merge_budget"} (#614).
  • Token verification (#575, #576, #577):
    • docs/auth.md is the canonical auth document. hoglake is a resource server: it issues no tokens on the request path and calls no issuer. docs/auth-tenancy.md is now design history (#575).
    • alg may be ES256 or RS256, and the JWKS may mix EC P-256 and RSA keys (#576):
      • A kid must select a key of the type its alg needs.
      • RSA keys under 2048 bits and JWKs whose alg contradicts their kty are refused at load.
      • Entries for other purposes, such as use other than sig or an encryption alg, are skipped.
    • Catalog grants may come from the OAuth scope claim, as space-separated hoglake:<catalog>:<scope> values (#576):
      • Non-hoglake: values are ignored.
      • A malformed hoglake: value refuses the token (invalid_token).
      • A token carrying both cat and scope must have them agree.
    • Contract vectors are generated in hoglake (just server contract-vectors), with an expect verdict per vector (#577).
    • ten is optional: a token without it is a tenant token. A token without ten that carries prd is refused. Scoped and operator tokens still need ten (#577).
    • New HOGLAKE_AUTH_SCOPED_MAX_LIFETIME_SECONDS (default 900) (#577).
    • New HOGLAKE_AUTH_CLIENT_CLASSES (default empty), up to 16 lowercase User-Agent product tokens, each with its own client label. The built-in map no longer names an issuer, and Go-http-client is now labelled go (#577).
  • Local issuer (#595):
    • HOGLAKE_AUTH_MODE=local behaves like enforce, but trusts only the public half of HOGLAKE_AUTH_SIGNING_KEY, an env-only base64url EC P-256 JWK.
      • HOGLAKE_AUTH_ISSUER defaults to hoglake in this mode.
      • Boot fails if a JWKS file or URL is also set, if the key is missing, or if the key is set under another mode.
      • The key is redacted in config dumps.
    • GET /.well-known/jwks.json (public) serves the key's public half. In every other mode it answers 404.
    • hoglake-server token keygen prints HOGLAKE_AUTH_SIGNING_KEY=<value>.
    • hoglake-server token mint signs a token offline. Flags: --catalog <name>[=<scope>], --scope, --operator, --org, --sub, --client, --ttl (default 24h). It does not mint scoped (prd) tokens. Also available as just server token ….
    • HOGLAKE_PUBLIC_PORT, HOGLAKE_BACKENDS_FILE and HOGLAKE_MOUNT_HOSTS_FILE accept local wherever they accepted warn / enforce.
  • JWT forwarding to hoglite (#589):
    • Only the current request's verified JWT is forwarded to the hoglite backend. Each request gets its own client wrapper, and transport, routing pins and breakers are shared.
    • A hoglite 401 or 403 maps to 401 invalid_token or 403 forbidden ("backend refused request authority").
    • Deleting a hoglite catalog requires an operator token (403 otherwise), checked before any write fence. Tenants are provisioned and deleted only by catalog-bound operator requests.
    • Table-creation receipt status reads are now read-only.
    • An aud array with a non-string entry is now refused as malformed. It used to be ignored.
    • Hoglite redirects are not followed, and an owner hint must be a DNS label.
  • Storage credentials for the server's own jobs (#594, #597, #600):
    • New HOGLAKE_STORAGE_PROVIDER=ambient|static|broker. Unset keeps the old rule: static when both HOGLAKE_S3_ACCESS_KEY and HOGLAKE_S3_SECRET_KEY are set, ambient otherwise. An inconsistent explicit choice fails boot and names the variable.
    • broker exchanges client credentials and is configured with:
      • HOGLAKE_STORAGE_BROKER_TOKEN_URL;
      • HOGLAKE_STORAGE_BROKER_CLIENT_ID and HOGLAKE_STORAGE_BROKER_CLIENT_SECRET;
      • HOGLAKE_STORAGE_BROKER_AUDIENCE (default hoglake).
    • The broker is then called at HOGLAKE_STORAGE_BROKER_URL with {"catalog","prefix","access"} and answers with STS-shaped credentials.
      • One session per (catalog, access), held in memory, single-flight.
      • Refreshed at min(HOGLAKE_STORAGE_BROKER_REFRESH_MARGIN_SECONDS (default 300), lifetime / 2) before expiry.
      • A held session is kept through broker failures, with a 5 s–60 s backoff.
      • The server keeps one S3 client per store and signs each request with the catalog's credentials.
    • Access levels are read < write < delete. The hydrator asks for read, compaction (and its layout probe) for write, and only cleanup asks for delete. write includes no s3:DeleteObject (#597).
    • Broker URLs must be https, or http to loopback only. HOGLAKE_STORAGE_BROKER_ALLOW_HTTP=true (default false) allows http to any host, for an in-cluster broker (#600).
  • Reserved namespaces (#573):
    • New HOGLAKE_RESERVED_NAMESPACES, a comma-separated list (default empty).
    • POST …/namespaces refuses a reserved name, compared ignoring ASCII case, with 422 validation. No caller is exempt, and nothing is written.
    • Each entry must match the identifier pattern, or the server does not start.
    • A namespace created before its name was reserved keeps working. Once dropped, it cannot be created again. docs/auth-tenancy.md §6.2c has the query that finds such namespaces.
  • Pinned reads (#572, #590, #605):
    • Every read that accepts snapshot / at_timestamp now resolves the namespace as it was at the pin, on both backends: getTable, listTables, listFiles, partitionValues, fileStats, changes (with to_snapshot) and planScan. After a drop and recreate they used to return the wrong incarnation, or 404.
    • A pinned read whose snapshot expires while it reads metadata now answers 410 expired, on PostgreSQL and hoglite (#605). Head reads are unchanged.
  • Hoglite head reads (#583): head getTable / listTables read the head, the namespace and table_totals in one read transaction. This removes the O(files) aggregate fallback a concurrent commit used to trigger.
    • Head listTables: 3–4 round trips → 1.
    • Head getTable: 7–9 round trips → 5.
  • Hoglite maintenance (#586, #587, #605, #606, #607). All of these are manual, per catalog and routed by the token's placement. Hoglite has no background loop, catalog registry or lease.
    • #586 adds a PostgreSQL maintenance seam. It changes no behaviour.
    • Catalog options GET/PATCH, and maintenance run recording to the ledger (best effort; a ledger failure never replaces the task's outcome) (#587).
    • POST …/maintenance/expire advances the retention floor, purges expired metadata in bounded pages, and queues ended files in the removal ledger (#605).
    • POST …/maintenance/cleanup drains the bulk and staging removal queues through the server's object store and purges old run records, receipts and drained removals (#606). It now emits the files-removed metric.
    • POST …/maintenance/rehydrate (manual requeue) changes metadata only (#607).
    • Retirement runs through the backend seam (#607). It has no HTTP trigger.
    • Status, run history and other maintenance on hoglite still answer 501 not_supported_on_backend.
    • New hoglite tenant indexes (#606): receipts_created_at, removals_staging_queue, removals_bulk_queue, removals_drained_at and maintenance_runs_started_at. These are first-release DDL with no tenant migration.
    • The hoglite alter transaction guards the planned sort maximum (#605).

pyhoglake / hedgerow

  • New ops.set_variant_shredding(name, shredding) (#580):
    • It validates the declaration locally against the server's grammar and copies it into the op.
    • Only None clears. {} and {"shredding": None} raise ValidationError locally (#614).
    • A no-op response re-seeds the handle's cache and DDL pin at the head, so nothing prepared earlier is invalidated.
    • variant.to_python / verify given a column check against the live declaration. To read a file written under an earlier declaration, pass shredding= or neither.
  • The auth module's docs are issuer-neutral (#575).
  • Variant codec: unchanged; only its CI workflow's action pins changed. The variant-codec extra still pins pyhoglake-variant-codec 0.1.0.
  • hedgerow: README only.

millrace

  • Credentials (#601). millrace now sends a credential to hoglake from HOGLAKE_AUTH_*. Set exactly one source:
    • client credentials: HOGLAKE_AUTH_TOKEN_URL, HOGLAKE_AUTH_CLIENT_ID and HOGLAKE_AUTH_CLIENT_SECRET, plus HOGLAKE_AUTH_AUDIENCE (default hoglake). These are minted, cached and refreshed, with one re-mint on a 401;
    • HOGLAKE_AUTH_TOKEN;
    • HOGLAKE_AUTH_TOKEN_FILE, read once at startup.
  • With no source set, millrace sends no header, as before. Two sources, or partial client credentials, exit 2.
  • After set_variant_shredding, the next flush is refused ddl_since_read_snapshot, and millrace rebuilds it on the new declaration (#580).

webui

  • Sign-in with a pasted access token (#560):
    • The token is held in sessionStorage only, and sent on /v1/* and /metrics. With no token, requests are unchanged.
    • A 401 drops the token and opens the panel, which says whether the token is expired, missing or refused. A token past its exp is dropped client-side.
    • Operator-only pages (central maintenance, database health) show a "needs an operator token" notice on 401, 403 or a typed 404.

CI / docs

  • CI:
    • The legacy gigahog state callbacks are removed from the release workflows. GHCR and ECR publication are unchanged (#585).
    • just test-hoglite runs the hoglite live tests locally in a Linux container (ci/hoglite-live-local.sh, ci/check-hoglite-live.sh) (#591).
    • New signed-commits PR check, and CONTRIBUTING.md documents the commit-signing setup (#603).
  • Docs:
    • Auth: docs/auth.md and docs/auth-roadmap.md (#575, #579, #581, #582, #593, #596, #598, #602).
    • Decided: jti stays required, and each server trusts one issuer (#599).
    • The README quick-start reads the append at its returned snapshot (#584).
    • Version strings are back to dev after 1.4.9 (#567).
  • Dependencies: Ktor 3.6.1 (#569), AWS SDK 2.57.10 (#604), webui npm minor/patch group (#568), GitHub Actions minor/patch group (#592).

Operators

  • Migrations: none.
  • Defaults:
    • Every new setting is off or matches 1.4.9:
      • HOGLAKE_STORAGE_PROVIDER unset keeps the old static-or-ambient rule;
      • HOGLAKE_STORAGE_BROKER_ALLOW_HTTP=false;
      • HOGLAKE_RESERVED_NAMESPACES empty;
      • HOGLAKE_AUTH_CLIENT_CLASSES empty;
      • HOGLAKE_AUTH_SCOPED_MAX_LIFETIME_SECONDS=900, the old fixed cap.
    • HOGLAKE_AUTH_MODE still defaults to off.
  • Metrics label change (#577): Go default-UA requests move from the old issuer label to client="go". A provisioner that sends its own UA product token is counted as other unless it is listed in HOGLAKE_AUTH_CLIENT_CLASSES. Update dashboards and alerts.
  • Token acceptance changes (#576, #577, #589):
    • Tokens without ten are now accepted as tenant tokens.
    • An aud array with a non-string entry is now refused.
    • A JWKS with an RSA key under 2048 bits, or with an alg/kty mismatch, fails to load.
  • Hoglite with forwarded JWTs (#589):
    • The backend must accept the forwarded token, and metadata grants must carry aud ["hoglake","hoglite"] (see docs/auth.md).
    • Before enabling hoglite enforcement, wait out the 15-minute lifetime of the existing single-audience tokens.
    • Deleting a hoglite catalog now needs an operator token.
  • Hoglite tenants: the new indexes (#606) have no migration. Drop and recreate existing development tenants to get them.
  • VARIANT compaction (HOGLAKE_COMPACTION_VARIANT=true):
    • Groups that were refused for mixed layouts now compact. Expect more rewrite work right after the upgrade, and split counts after any set_variant_shredding.
    • Retained footers (up to 16 MiB of serialized footer bytes per group; larger once parsed) sit outside HOGLAKE_COMPACTION_SORTED_HEAP_BYTES. Leave heap headroom for them.
    • unconvertible_schema no longer counts mixed-layout groups.
    • A steady layout_probe_only rate above what arrivals explain means the layout memory is being lost: restarts, the 250k-entry cap, or shape eviction.
  • Storage broker (#597): a broker must accept the delete access level, which cleanup now requests. A broker that grants delete with write keeps working, but over-grants compaction.
  • millrace (#601): a pod that has more than one HOGLAKE_AUTH_* credential source set exits 2 at startup. A millrace pod writing to a warn, enforce or local server needs a credential with write on its destination catalog.