Skip to content

fix(ingest): continuous datasources are not validate_only - #253

Open
eddietejeda wants to merge 1 commit into
mainfrom
fix/continuous-not-validate-only
Open

fix(ingest): continuous datasources are not validate_only#253
eddietejeda wants to merge 1 commit into
mainfrom
fix/continuous-not-validate-only

Conversation

@eddietejeda

Copy link
Copy Markdown
Contributor

Urgent: --continuous currently 422s in the field

new-datasource set req.validate_only = true unconditionally ("adding a datasource discovers the schema only"), so --continuous produced a spec carrying both continuous and validate_only.

That is exactly the combination the worker now rejects with a 422 (dlthubworker #193, deployed): the scheduler re-runs such a datasource every tick but the drain falls to the full-replace path — reloading the whole bucket forever. It was the root cause of the otel_telemetry incident (silently, before the guard).

Now that #193 is live in prod, hotdata ingest new-datasource --continuous fails 422 every time. This restores it.

Fix

A continuous datasource is a persistent, self-loading source the scheduler keeps synced — the opposite of a one-off schema preview. So set validate_only only when not continuous:

req.validate_only = !req.continuous;
  • Non-continuous adds are unchanged (discover schema, then a separate import loads).
  • --continuous (incl. shaped --record-shape otel_traces) now creates a ready-to-sync datasource — verified end to end against prod: the re-registered otel_telemetry seeded via the incremental path and landed 93k spans.
  • Test create_request_filesystem_carries_continuous_flag strengthened to assert !validate_only for continuous and validate_only for a plain add.

Release

Should ship promptly as a patch (0.23.1) — --continuous is broken in 0.22.0/0.23.0 against the current worker.

new-datasource unconditionally set validate_only=true ("discover schema, don't
load"), so --continuous produced a spec with BOTH continuous and validate_only.
That is the exact combination the worker now rejects (422): the scheduler
re-runs it every tick but the drain falls to full-replace, reloading the whole
bucket forever. It was the root cause of the otel_telemetry incident.

A continuous datasource is a persistent, self-loading source the scheduler keeps
synced — the opposite of a one-off schema preview. Set validate_only only when
NOT continuous. Without this, --continuous is unusable against a worker carrying
the guard (dlthubworker #193): every attempt 422s.
@eddietejeda
eddietejeda requested a review from a team as a code owner August 9, 2026 16:57
@eddietejeda
eddietejeda requested review from anoop-narang and removed request for a team August 9, 2026 16:57
Comment thread src/commands/ingest.rs
// worker rejects the pair 422, and before it did, the datasource was
// re-run every tick but fell to the full-replace path — reloading the whole
// bucket forever. So continuous datasources are created ready to sync.
req.validate_only = !req.continuous;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the post-create UX still assumes a validate-only add (not blocking).

With validate_only = false, the create job for a --continuous datasource now actually seeds data, but run_source (src/commands/ingest.rs:1335-1343) still polls with the verb "discovering schema" and render_datasource_added finishes with Import data with: hotdata ingest new-import --source {source} --all. For a continuous source that hint is wrong — it's self-loading and the scheduler keeps it synced. Also, the default --wait-timeout of 300s was sized for schema discovery; an initial full seed of a large bucket can blow past it and exit 2 (recoverable via the printed status --wait hint, but surprising).

Threading the continuous flag down to pick the verb ("seeding datasource") and swap the trailing hint would make the success output match what actually happened.

Comment thread src/commands/ingest.rs
};
// Adding a datasource discovers the schema only — never loads data.
req.validate_only = true;
// Adding a datasource discovers the schema only — never loads data — EXCEPT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: skills/hotdata/SKILL.md:250 still says new-datasource "Validates credentials + discovers the schema; loads NO data", and the --continuous bullet at line 259 only describes the scheduled re-runs. After this change the --continuous add does load data up front. Worth a clause on line 259 noting the create seeds the initial load (not blocking).

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix is correct and scoped: only the flag-driven path sets continuous (the wizard never does), so validate_only = !req.continuous leaves every other family and the wizard path unchanged. Test assertions cover both directions. Two non-blocking notes inline.

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant