Skip to content

hoglake: attribute every DDL request; pyhoglake 1.4.0; server image 1.4.0 - #153

Merged
jghoman merged 1 commit into
mainfrom
hoglake-attribution
Oct 21, 2026
Merged

jghoman merged 1 commit into
mainfrom
hoglake-attribution

Conversation

@jghoman

@jghoman jghoman commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Closes PostHog/hoglake#366.

hoglake 1.4.0 (PostHog/hoglake#372) records author and message on DDL — required on drop, truncate, table replacement and retention reduction, optional on create and alter. millpond only creates and alters, so nothing is refused by a 1.4.0 server; this attributes what it does.

What

  • Author: the sink's existing millpond/<table>/<ordinal>, the identity its data commits already carry, now on every DDL request.
  • Message: <why>: <what>; ENV=value…, deterministic (no clock), naming the topic and the settings that produced the definition. Examples:
    • first flush of events_json: create table analytics.events with 5 columns from the batch; HOGLAKE_PARTITION_BY=identity(team_id), day(_inserted_at); MILLPOND_SORT_BY=team_id,uuid; MILLPOND_TYPED_COLUMNS=uuid:uuid,team_id:bigint
    • recovery for events_json (table exists without its sort order): declare sort order; MILLPOND_SORT_BY=uuid
    • schema evolution from events_json: add columns c1 (string), c2 (long) / … promote column count from int to long
  • Call sites: create_catalog, create_namespace, create_table, spec declaration (both recovery paths), batched and per-column add_column, promote_column. AlreadyExistsError / CommitConflictError handling unchanged; a retried declaration sends identical text.
  • pyhoglake[fast-upload]>=1.4.0, with the exclude-newer carve-out moved past its upload (2026-10-21T18:54Z).
  • Test stack DEFAULT_IMAGE → the 1.4.0 server index digest. The suite's own table drops carry author/message (that server requires them); the snapshot helpers now separate data commits from DDL snapshots, which share the sink's author.

Tests

  • Unit: new TestDdlAttribution (17) — exact wire payload per call site, unset rendering, only-sent ops in the message, both recovery paths, identical text on retry, per-column fallback, every DDL call on a cold bootstrap attributed, retries after AlreadyExistsError and CommitConflictError.
  • Integration: new TestDdlAttribution against the real server records the request bodies httpx sent and asserts author/message on catalog/namespace/table creation and all three alters, then the persisted attribution via GET /v1/catalogs/{c}/snapshots. Catalog creation precedes snapshot history, so it is checked on the wire only.
  • just test 1424 passed; test-integration 103; test-hoglake-integration 50 and test-hoglake-e2e 7 against the 1.4.0 image; test-e2e 4; lint and format clean.

….4.0

hoglake 1.4.0 (#372) records author and message on DDL: required on
drop, truncate, table replacement and retention reduction, optional on
create and alter. millpond only creates and alters, so nothing was
refused, but its catalog, namespace and table creation, spec
declaration and schema evolution were unattributed (hoglake #366).

Every DDL call now carries the sink's existing author,
millpond/<table>/<ordinal>, the one its data commits already use, and a
deterministic message of the form "<why>: <what>; ENV=value", naming
the topic and the MILLPOND_* / HOGLAKE_* settings that produced the
definition: first flush of a topic creating the table with N columns
from the batch and its partition/sort settings; the two spec-recovery
paths saying which spec was missing; schema evolution naming the
columns added or the promotion made. Nothing in it changes between
attempts, so a retried declaration sends the same text. AlreadyExists
and CommitConflict handling is untouched.

pyhoglake[fast-upload]>=1.4.0 for the keyword arguments, with the
exclude-newer carve-out moved past its upload. The hoglake test stack's
DEFAULT_IMAGE is the 1.4.0 server index digest; the suite's own drops
now carry author and message, which that server requires, and the
snapshot helpers distinguish data commits from the DDL snapshots that
now share the sink's author.

Unit 1424 passed; integration 103; hoglake-integration 50 and
hoglake-e2e 7 against the 1.4.0 image; e2e 4.
@jghoman
jghoman merged commit 0268efe into main Oct 21, 2026
17 checks passed
@jghoman
jghoman deleted the hoglake-attribution branch October 21, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

millpond: attribute first-flush table creation and schema changes

1 participant