Skip to content

Conversation

@arteam
Copy link
Contributor

@arteam arteam commented Feb 7, 2025

  • Support returning getLastUnsafeSegmentGenerationForGets for any Engine, not only InternalEngine
  • Retry real-time gets on AlreadyClosedException in case a shard's engine gets swapped.

See ES-10571

@arteam arteam added WIP :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. labels Feb 7, 2025
@elasticsearchmachine elasticsearchmachine added v9.1.0 serverless-linked Added by automation, don't add manually labels Feb 7, 2025
@arteam arteam changed the title Support returning latest hollow generation real-time GET requests Make mult-get request and response accessible outside of TransportShardMultiGetFomTranslogAction Feb 9, 2025
@arteam arteam changed the title Make mult-get request and response accessible outside of TransportShardMultiGetFomTranslogAction Make mult-get request and response publicly accessible Feb 9, 2025
@arteam arteam marked this pull request as ready for review February 10, 2025 08:10
@arteam arteam changed the title Make mult-get request and response publicly accessible Support real-time gets on hollow shards Feb 10, 2025
@arteam arteam requested review from fcofdez and kingherc February 10, 2025 11:50
@arteam arteam requested a review from kingherc February 11, 2025 07:18
@arteam arteam removed the WIP label Feb 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Indexing Meta label for Distributed Indexing team label Feb 11, 2025
Copy link
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I left a couple of comments

return threadPool.executor(executorSelector.executorForGet(shardId.getIndexName()));
} else if (indicesService.indexServiceSafe(shardId.getIndex()).getIndexSettings().isSearchThrottled()) {
}
var indexService = indicesService.indexService(shardId.getIndex());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/elastic/elasticsearch/pull/122012/files#r1950399319

I've seen an IndexNotFoundException being thrown here during the stress testing of real-time gets which failed the request, because we don't expect it here. Let me double check if it's still the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to be failing with something like

Caused by: java.lang.IllegalStateException: unexpected exception processing cluster state version [112] in context [ClusterStateObserver[null]]
	at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.logUnexpectedException(ClusterStateObserver.java:317)
	... 12 more
Caused by: [rjsadmjle/ScBnoey6QYqfReJ_JhmkhA] org.elasticsearch.index.IndexNotFoundException: no such index [rjsadmjle]
	at org.elasticsearch.indices.IndicesService.indexServiceSafe(IndicesService.java:586)
	at org.elasticsearch.action.get.TransportGetAction.getExecutor(TransportGetAction.java:169)
	at org.elasticsearch.action.get.TransportGetAction.tryGetFromTranslog(TransportGetAction.java:297)
	at org.elasticsearch.action.get.TransportGetAction.getFromTranslog(TransportGetAction.java:263)
	at org.elasticsearch.action.get.TransportGetAction$1.onNewClusterState(TransportGetAction.java:241)

but it doesn't anymore, so I've reverted in in b965926

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still see the change, maybe you forgot to change this branch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arteam can we revert this change here (and in GET) if it's not needed? Before I approve.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kingherc My bad, it came back with another commit. Reverted in 8d4ab8e

Copy link
Contributor

@kingherc kingherc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final comment from me.

@arteam arteam requested review from fcofdez and kingherc February 11, 2025 10:38
@arteam arteam requested review from fcofdez and kingherc and removed request for fcofdez and kingherc February 11, 2025 11:58
@arteam arteam requested a review from fcofdez February 11, 2025 14:29
Copy link
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@kingherc kingherc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please ensure CI passes before merging.

@arteam arteam merged commit ecda919 into elastic:main Feb 11, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue serverless-linked Added by automation, don't add manually Team:Distributed Indexing Meta label for Distributed Indexing team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants