perf(opensearch): Remove refresh="wait_for" from OpenSearch storage backends#2786
Conversation
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Please keep
Without So this method should keep its own write-then-search consistency contract, for the same reason |
|
Please add short comments at the KV / graph / vector storage mutation sites explaining why removing per-operation Suggested scope of the rationale:
|
Good catch, I'll restore |
Removing
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Description
Every individual
upsert,delete, anddelete_by_querycall in the OpenSearch storage backends used refresh="wait_for", which forces OpenSearch to wait for a segment refresh before returning. With ~1,900+ storage operations during a typical ainsert, this added ~1,400s of unnecessary waiting (1,668s total vs 265s for default file-based storage).Remove
refresh="wait_for"from all individual write operations across OpenSearch storage classes, replacing it with reliance on OpenSearch's translog for read-after-write consistency and index_done_callback() for batch refresh. This eliminates a ~0.9s penalty per operation, yielding a 7.1x improvement in total storage time during document indexing.Change details
Performance profiling (without LLM cache, remote embedding model ) achieves a 7.1x speedup (1,668s → 234.5s)
Profiling (without LLM cache)
Before
After
Related Issues
#2785
Checklist
Additional Notes
[Add any additional notes or context for the reviewer(s).]