Repository navigation
fix(elasticsearch): propagate search failures with index context - #20546
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughSearch now returns an error when an index search fails, preserves response-body read errors, and treats an ChangesElasticsearch Search Error Handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk was established; the search error-handling change is ready for normal merge checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The reviewed request path retains tenant scoping and generic error responses while making incomplete searches fail explicitly. No introduced security issue was established, but broader caller exposure and production behavior remain incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks each index trail, Comment |
|
Added Go documentation for the search failure contracts and controlled response fixtures in 4d15d48. This update changes comments only. Formatting and diff checks passed, and the regression files remain selected by the default unit-test flags. Functional tests were not rerun for this documentation-only update. |
Summary
Ordinary multi-index searches currently discard each index error and return empty or incomplete results as success. Return transport, backend, response-read and decoding errors with the failing index and preserve the underlying error for
errors.Is.Retain empty results for a well-formed
index_not_found_exceptionresponse, so an unindexed tenant does not turn an empty query into an application error. Other 404 responses remain failures. The Elasticsearch search API documents unavailable-target handling; this change retains the existing missing-index empty case. Successful aggregation and request-body reuse remain covered.Related: #19736 addresses error propagation within a broader retrieval change. This PR isolates the current
searchOneIndexpath and preserves empty results for missing indices; the transport/read and multi-index regression coverage can be coordinated with that work.Validation:
bash build.sh --test ./internal/engine/elasticsearch. Transport stubs cover successful and empty searches, mixed populated/missing indices, backend failures, unrelated 404s, malformed and truncated responses, and partial multi-index failures. Real Elasticsearch integration has not been run.