Skip to content

Avoiding failure when using frozen indices #1842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Jan 4, 2022

This commit changes es-hadoop to treat frozen indices as empty indices rather than throwing exceptions. Before
this change if you query a frozen index with es-hadoop or spark you get job failure with an exception like this:

org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3) (localhost executor 2): org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: invalid response
	at org.elasticsearch.hadoop.util.Assert.isTrue(Assert.java:60)
	at org.elasticsearch.hadoop.serialization.ScrollReader.read(ScrollReader.java:272)
	at org.elasticsearch.hadoop.serialization.ScrollReader.read(ScrollReader.java:263)
	at org.elasticsearch.hadoop.rest.RestRepository.scroll(RestRepository.java:313)
	at org.elasticsearch.hadoop.rest.ScrollQuery.hasNext(ScrollQuery.java:94)
	at org.elasticsearch.spark.rdd.AbstractEsRDDIterator.hasNext(AbstractEsRDDIterator.scala:66)
	at org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1889)
	at org.apache.spark.rdd.RDD.$anonfun$count$1(RDD.scala:1253)
	at org.apache.spark.rdd.RDD.$anonfun$count$1$adapted(RDD.scala:1253)
	at org.apache.spark.SparkContext.$anonfun$runJob$5(SparkContext.scala:2254)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
	at org.apache.spark.scheduler.Task.run(Task.scala:131)
	at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:506)
	at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1462)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:509)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

We don't want to change behavior to read frozen indices by default since they will be very slow. We might add some config to have es-hadoop pass in ignore-throttled so that frozen indices can be queried. But since they are deprecated that might not be worth the effort.
Relates #1734

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM

@masseyke masseyke merged commit 755aa1c into elastic:master Jan 26, 2022
@masseyke masseyke deleted the fix/exception-on-frozen-indices branch January 26, 2022 22:47
masseyke added a commit to masseyke/elasticsearch-hadoop that referenced this pull request Jan 26, 2022
masseyke added a commit to masseyke/elasticsearch-hadoop that referenced this pull request Jan 26, 2022
@masseyke masseyke added the :Core label Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants