fix(BUY-63030): route MCP catalog reads through catalogDb; surface unavailable on zero-count category fallback#235
Open
BuyWhere wants to merge 1 commit into
Open
Conversation
…available on zero-count category fallback - Switch search_products, get_product, compare_products, get_deals, list_categories, find_best_price, probeDiscountPctColumn, and the regional FTS fallback in get_deals from primary db to catalogDb so the canonical ~127M catalog is served. - Keep ingestion/auth/health endpoints on primary db (write paths + liveness checks). - list_categories already recomputes unavailable from cached rows so pre-fix zero-count static fallbacks now surface unavailable:true after deploy.
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.
Context
Parent: BUY-63027 (SEV-1 MCP fabricated cache regression). BUY-63030 is the deploy-and-verify subtask.
Live MCP probe at 2026-07-17T03:24Z showed:
Root cause
MCP catalog reads were routing through the primary maglev DB (the catalog ingestion primary), which has been returning the fabricated/stale total rows seen in BUY-62788 / BUY-63027. The catalogDb pool already exists in mcp-railway/src/config.ts (BUY-53789, pointed at the canonical ~127M-row catalog replica), but src/routes/mcp.ts was never switched to use it for catalog reads.
Local patch
Test plan
After merge + deploy, expect list_categories to return meta.unavailable:true until cache TTL clears AND mcp_category_summary_by_country is populated; then nonzero counts with unavailable:false.