Skip to content

datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578

Description

@os-steve

Split out of #13408 by the domain:cli PM seat (#6024) at dispatch time, unlabelled for triage. Filed separately because it is decision-independent and #13408 is not, see below.

The defect

On a multi-node deployment, a datasource whose driver fails to start leaves a stuck driver instance in the in-memory data-engine driver registry. Deleting the datasource does not clear it:

  • DELETE /api/v1/datasources/:name → the admin-door list is empty on every replica…
  • …but GET /api/v1/ready still names that datasource's driver and still answers 503.
  • No API door evicts the engine-registry entry. Only a process restart clears it.

So an administrator who reacts to a bad datasource with the single most natural action — delete it — gets no recovery, and on a shared/HA cluster the remaining remedy is a restart of every replica.

Why this is filed apart from #13408, and not held behind it

#13408 bundles two halves. Its other half — should one unhealthy driver drain whole-node readiness? — turned out to be intentional, documented behaviour, so it is a product decision and #13408 has been moved to the decision box (analysis on that card).

This half is not that. It is a defect under either answer to the readiness question:

  • If a bad driver should drain the node, then a deleted datasource must stop draining it — otherwise the drain is unrecoverable by design.
  • If it should not, this is still a registry that leaks entries no door can reach.

⇒ Holding it behind the decision would park a live defect inside a decision it does not depend on. Recording that reasoning here so the split is auditable rather than looking like scope drift.

What the fix needs to answer

The repair is not only the DELETE path — that is the one path that happened to be observed:

  • Enumerate every path that can leave an orphan driver instance, by walking the registry's lifecycle rather than by example: failed-start rollback, tenant deletion, datasource rename/reconfigure, environment teardown. ⛔ An answer of the form "fixed DELETE" leaves the others.
  • Decide where eviction belongs — the delete path calling the registry, or the registry owning its own liveness — and say why.
  • ⚠️ Cluster propagation is part of the shape, not a detail. [security] datasource credential in a nested config position is served in cleartext on read — redaction is top-level-key-only #13405 records the sibling asymmetry on a different registry: create broadcasts cluster-wide, delete does not mirror. If eviction is local-only, one replica recovers and the rest do not, which is the same bug with a smaller blast radius.

Landing surface

The data-engine driver registry plus the datasource delete path — not packages/runtime/src/http-dispatcher.ts, which only reports the registry's contents at /ready. #13408's triage note flagged this half as needing engine/services alignment; routing is triage's call, which is why this card is filed unlabelled.

Refs

Observed on a live 3-replica EE deployment during the #13404 checklist run; recovered by restart.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions