Repository navigation
[2.0] Fixes 35914: Prevent closed readers in OpenSearch embedding updates - #35945
gh-bot-collate[bot] wants to merge 1 commit into
Conversation
…rs (#35917) Load shared OpenSearch vector settings from the spec mappings for entity and chunk indexes, including staged chunks. Disable derived vector source while preserving embedding indexing and kNN search. Reproduce the reader lifecycle failure on OpenSearch 3.4 with concurrent updates, merges and scroll cleanup. Verify partial updates preserve source fields and vector searches still work. Document the disk storage tradeoff and full reindex required for existing indexes. (cherry picked from commit 1cfeb2b)
| Entity.setSearchRepository(previousRepository); | ||
| final var dispatcher = EntityLifecycleEventDispatcher.getInstance(); | ||
| dispatcher.unregisterHandler(SearchIndexHandler.class.getSimpleName()); | ||
| previousHandlers.forEach(dispatcher::replaceHandler); |
There was a problem hiding this comment.
Integration tests cannot compile
EntityLifecycleEventDispatcher has no replaceHandler method on this branch. This method reference prevents the integration-test module from compiling, so its tests cannot run. Use the available registerHandler method after removing the temporary search handler, or backport the missing API.
| previousHandlers.forEach(dispatcher::replaceHandler); | |
| previousHandlers.forEach(dispatcher::registerHandler); |
| throws IOException { | ||
| if (chunks) { | ||
| vectorService.writeEntityChunks("seed", List.of()); | ||
| return vectorService.getChunkIndexName(); |
There was a problem hiding this comment.
createIndex returns from both the chunk branch and the end of the method. The Java guide requires one return statement at the end. Assign the chosen index name to a local variable and return it once. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| service.executeGenericRequest("POST", "/" + index + "/_flush", null); | ||
| } | ||
|
|
||
| private void exerciseReaders(OpenSearchVectorService service, String index) throws Exception { |
There was a problem hiding this comment.
Missing required final declarations
The new methods leave unchanged parameters and local variables without final. The Java guide requires final for values that do not change. Apply it to parameters such as service and index, and locals such as executor and result. The pattern appears elsewhere in this test and in loadVectorIndexMapping. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| final var updatedVector = Collections.nCopies(DIMENSION, 0.2); | ||
| vectorService.partialUpdateEntity( | ||
| index, "500", Map.of("embedding", updatedVector, "fingerprint", "updated")); |
There was a problem hiding this comment.
The new test repeats raw strings such as embedding and fingerprint. The Java guide requires strings used more than once to have one named constant. Reuse existing constants where available, or define shared constants for these values. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|



Automated backport of #35917 to
2.0.1cfeb2bcf658d70bd9395a272f5e77b836b0ed44main.Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #35917 is asked to look.
resolver run
Do not merge until the integration test compiles and the explicit Java requirements are satisfied.
Findings
Summary
Keeps OpenSearch vectors in
_sourceto avoid closed-reader failures during embedding updates._source.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Settings["Shared vector settings"] --> Entity["Entity index creation"] Settings --> Chunk["Chunk index mapping"] Chunk --> Live["Live chunk index"] Chunk --> Staged["Staged chunk index"] Entity --> Source["Keep vectors in _source"] Live --> Source Staged --> SourceReviews (1) · Last reviewed commit: "Fixes #35914: Keep OpenSearch vectors in..." · Reviewed by Greptile