Repository navigation
buzz-db: move the search pool and Postgres search SQL behind buzz-db - #10091
Open
TheSentinel454 wants to merge 3 commits into
Open
TheSentinel454 wants to merge 3 commits into
TheSentinel454 wants to merge 3 commits into
Conversation
TheSentinel454
requested review from
a team,
bradseiler,
ravarora2,
salman1993 and
wpfleger96
as code owners
December 1, 2026 22:07
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
TheSentinel454
force-pushed
the
elrond/buzz-811-search-store
branch
from
December 1, 2026 22:50
e37a5d1 to
cfb1548
Compare
buzz-search built its own pool and ran its own SQL: the FTS and profile-name queries, the abandoned-search cancel, and the outbox gauge read. The indexer reached the writer pool through Db::pool(). - The FTS query module and its cancel logic move to buzz_db::search, unchanged except for the error type. A SearchStore owns the search pool. SearchStore::connect builds it the way the relay used to. - SearchService takes a SearchStore instead of a PgPool. buzz-search re-exports the query types, so callers keep their imports. - The indexer and the outbox gauges use Db::search_outbox_store(). The gauge read takes a Db, so the relay sampler no longer needs the writer pool. - SearchError::Db holds a DbError instead of sqlx::Error. buzz-search no longer uses sqlx in production, so it moves to its dev-dependencies. The search pool construction test moves from the relay to buzz-db. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Luke Tornquist <tornquist@squareup.com>
The statement-timeout check now builds its pool with SearchStore::connect, so it fails if the production constructor stops installing the hook. Also drop buzz-search's unused buzz-datastore-tracing dependency, remove an orphaned relay doc comment, and name the push gateway as the exception in ARCHITECTURE.md. Signed-off-by: Luke Tornquist <tornquist@squareup.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TheSentinel454
force-pushed
the
elrond/buzz-811-search-store
branch
from
December 2, 2026 00:11
cfb1548 to
2e5febc
Compare
TheSentinel454
changed the base branch from
main
to
elrond/buzz-811-audit-store
December 2, 2026 00:11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Luke Tornquist <tornquist@squareup.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #10090. Merge that first.
Summary
buzz-searchran its own Postgres SQL and built its own search pool. The relay built that pool too. This PR moves both intobuzz-db, sobuzz-searchreaches Postgres only throughbuzz-dbhandles.buzz-search/src/query.rsbuzz_db::search(store/search.rs)buzz-search/src/cancel.rsbuzz_db::search::cancelconnect_search_pool)buzz_db::SearchStore::connectSearchServicestoragePgPoolSearchStoresqlxinindexer.rsSearchOutboxStoreviaDb::search_outbox_store()sqlxinoutbox_metrics.rsSearchOutboxStore::statsbuzz-searchkeeps the backend choice, the OpenSearch client, the indexer loop and the result types. It re-exports the moved query types, so callers ofbuzz_search::*do not change.buzz-searchno longer usessqlxin production code, sosqlxmoves to its dev-dependencies.SearchError::Dbnow wrapsbuzz_db::DbError.This is the third of three steps that take raw pool access and SQL out of every crate except
buzz-db. The first two move the relay, admin and deletion callers (#10087) and the audit log SQL (#10090).What got simpler
buzz-searchdropssqlxandbuzz-datastore-tracingfrom its production dependencies.connect_search_pooland its test move intobuzz-dbnext to the other pool constructors.ARCHITECTURE.mdstates one rule ("every crate reaches Postgres only throughbuzz-db"), with the separate push gateway as the only exception.Behavior
No behavior change. The search pool keeps its settings: lazy, the reader URL when set (else the writer URL), the configured acquire timeout, and the same per-session read statement timeout. The SQL text is unchanged.
Tests
search_pool_is_lazy_prefers_the_reader_and_bounds_acquiremoves from the relay tobuzz-db.search_store_bounds_every_statement(Postgres,buzz-db) replacesbuzz-search'ssearch_pool_bounds_every_statement. It builds the pool throughSearchStore::connect, so it fails if the production constructor stops installing the statement-timeout hook.buzz-searchtests buildSearchServicefromSearchStore::from_pool.-D warnings) onbuzz-db,buzz-searchandbuzz-relay; unit tests for those crates; the Postgres search tests inbuzz-db,buzz-searchandbuzz-relaythat do not need OpenSearch.🤖 Generated with Claude Code