Skip to content

[9.3] Fix GPU merge ClassCastException with wrapped directories (#143531)#143924

Merged
elasticsearchmachine merged 4 commits intoelastic:9.3from
mayya-sharipova:backport/9.3/pr-143531
Mar 10, 2026
Merged

[9.3] Fix GPU merge ClassCastException with wrapped directories (#143531)#143924
elasticsearchmachine merged 4 commits intoelastic:9.3from
mayya-sharipova:backport/9.3/pr-143531

Conversation

@mayya-sharipova
Copy link
Copy Markdown
Contributor

Backports the following commits to 9.3:

…3531)

MemorySegmentUtils directly cast the Directory to FSDirectory,  but
Elasticsearch wraps directories in Store$StoreDirectory  (which extends
FilterDirectory, not FSDirectory). When vector  data exceeds
MMapDirectory's max chunk size, the fallback path  hit this cast and
threw a ClassCastException, failing all shard merges.

ClassCastException:     Store$StoreDirectory cannot be cast to
FSDirectory     (Store$StoreDirectory is in module    
org.elasticsearch.server; FSDirectory is in module    
org.apache.lucene.core)

Use FilterDirectory.unwrap() to peel through wrapper layers before
casting.

Also fix log message formatting for segment size values.

Relates to elastic#141872
@mayya-sharipova mayya-sharipova added :Search Relevance/Vectors Vector search >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch test-gpu Run tests using a GPU labels Mar 10, 2026
@mayya-sharipova mayya-sharipova added test-gpu Run tests using a GPU and removed test-gpu Run tests using a GPU labels Mar 10, 2026
@elasticsearchmachine elasticsearchmachine merged commit 371d8e1 into elastic:9.3 Mar 10, 2026
37 checks passed
@mayya-sharipova mayya-sharipova deleted the backport/9.3/pr-143531 branch March 10, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch test-gpu Run tests using a GPU v9.3.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants