fix(wintermute): suppress duplicate_table NOTICE flood from bulk staging tables - #239
Open
afbase wants to merge 1 commit into
Open
fix(wintermute): suppress duplicate_table NOTICE flood from bulk staging tables#239afbase wants to merge 1 commit into
afbase wants to merge 1 commit into
Conversation
…ing tables The bulk indexer creates its _bulk_* staging tables with CREATE TEMP TABLE IF NOT EXISTS on every batch. Pools recycle with RecyclingMethod::Fast, which never discards temp tables, so they survive for the life of a connection and every batch after the first raises a duplicate_table NOTICE that tokio-postgres logs at INFO. That stream dominates the log output and shortens how far back the journal reaches. Set client_min_messages=warning on every pool through a shared config::pg_connect_options(), so the server never generates or transmits the notice. A client-side log filter would still pay to generate and send it.
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.
The bulk indexer creates its
_bulk_*staging tables withCREATE TEMP TABLE IF NOT EXISTSon every batch. Pools recycle withRecyclingMethod::Fast, which never discardstemp tables, so they persist for the life of a connection and every batch after the first
raises a
duplicate_tableNOTICE that tokio-postgres logs at INFO. That stream dominatesthe log output and shortens how far back the journal reaches, which makes incident
forensics harder.
This adds
config::pg_connect_options()and sets it on every pool, so the server is toldclient_min_messages=warningand never generates or transmits the notice. A client-sidelog filter would still pay for generating and sending it.
The redundant DDL itself is left in place here and addressed separately, because removing
it requires every pool that reaches the bulk path to pre-create the staging tables.
Test plan
cargo clippy -p rsky-wintermute --all-targets --no-deps -- -D warningscargo test -p rsky-wintermutecargo build --release -p rsky-wintermutetokio_postgresNOTICE lines after restartdirect_indexandcar_loaderstill index a repo end to end