Skip to content

fix: org-scoped ClickHouse issues#3

Open
deepshekhardas wants to merge 33 commits into
mainfrom
fix/pr-3333-clickhouse
Open

fix: org-scoped ClickHouse issues#3
deepshekhardas wants to merge 33 commits into
mainfrom
fix/pr-3333-clickhouse

Conversation

@deepshekhardas

@deepshekhardas deepshekhardas commented May 12, 2026

Copy link
Copy Markdown
Owner

Removes unused schema fields (keepAliveEnabled, keepAliveIdleSocketTtl, maxOpenConnections) from the runs-replication-create API that were being silently dropped. Also moves the ClickHouse client lookup inside the deferred error handling in the logs route so failures are properly handled by TypedAwait.


Summary by cubic

Fixes org-scoped ClickHouse routing by moving client selection into deferred error handling, and cleans up the runs replication API schema to avoid silently dropped fields.

  • Bug Fixes
    • Logs: look up the ClickHouse client inside the deferred error handler so org-scoped client resolution errors are captured by TypedAwait and returned correctly.
    • API: remove unused fields (keepAliveEnabled, keepAliveIdleSocketTtl, maxOpenConnections) from the runs-replication-create schema to prevent confusion and silently ignored input.

Written for commit 41b3b46. Summary will update on new commits.

matt-aitken and others added 30 commits April 24, 2026 12:08
The only way to get a ClickHouse client now is through the factory.

Refactored all existing code to use that and pass in an org.

The runReplication and otlpExporter are the hot paths here which need special attention in reviews.
…resenter clients

Co-Authored-By: Matt Aitken <matt@mattaitken.com>
Co-Authored-By: Matt Aitken <matt@mattaitken.com>
The factory should not import eventRepository.server.ts — doing so pulls
the tracePubSub singleton into any module graph that imports the factory,
which eagerly connects to Redis at module load time (see singleton.ts).

The fallback now lives in index.server.ts via getEventRepositoryForStore,
which is called from RunPresenter, SpanPresenter, and recordRunEvent.
This restores runsReplicationBenchmark.test.ts's module isolation while
still handling non-ClickHouse ("taskEvent"/"postgres") stores.

Co-Authored-By: Matt Aitken <matt@mattaitken.com>
Sort findMany() by `key` for a stable winner when multiple rows assign the
same `${orgId}:${kind}`, and log an error identifying the winning and
ignored rows instead of overwriting silently. Does not fail the load —
failing the registry would break every customer, not just the misconfigured
orgs.

Co-Authored-By: Matt Aitken <matt@mattaitken.com>
matt-aitken and others added 3 commits April 24, 2026 12:08
…stry.server.ts

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Remove unused schema fields (keepAliveEnabled, keepAliveIdleSocketTtl, maxOpenConnections)
- Move ClickHouse lookup inside deferred error handling in logs route

These fixes address review comments from PR triggerdotdev#3333.
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.

2 participants