Skip to content
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

Core: delete-by-query fails to replay from translog < 1.0.0 Beta2 #10262

Closed
mikemccand opened this issue Mar 25, 2015 · 0 comments
Closed

Core: delete-by-query fails to replay from translog < 1.0.0 Beta2 #10262

mikemccand opened this issue Mar 25, 2015 · 0 comments

Comments

@mikemccand
Copy link
Contributor

Working on #10067, improving our back-compat test indices so that the translog has a delete-by-query on upgrade, I hit this pre-existing back-compat bug where on upgrade of an index <= 1.0.0 Beta2 that has a DBQ in its translog, this exception shows up:

  1> [2015-03-25 08:57:35,714][INFO ][index.gateway            ] [node_t3] [test][0] ignoring recovery of a corrupt translog entry
  1> org.elasticsearch.index.query.QueryParsingException: [test] request does not support [range]
  1>    at org.elasticsearch.index.query.IndexQueryParserService.parseQuery(IndexQueryParserService.java:362)
  1>    at org.elasticsearch.index.shard.IndexShard.prepareDeleteByQuery(IndexShard.java:537)
  1>    at org.elasticsearch.index.shard.IndexShard.performRecoveryOperation(IndexShard.java:864)
  1>    at org.elasticsearch.index.gateway.IndexShardGateway.recover(IndexShardGateway.java:235)
  1>    at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:114)
  1>    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  1>    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  1>    at java.lang.Thread.run(Thread.java:745)

This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

I have changes to create-bwc-index.py that shows the bug ... but I'm not sure how to cleanly fix it. Somehow on parsing a translog entry from an old enough version of ES we need to insert "query" at the top...

@s1monw s1monw added v1.6.1 and removed v1.6.0 labels Jun 3, 2015
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jun 3, 2015
This is happening because of elastic#4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes elastic#10262
@s1monw s1monw self-assigned this Jun 3, 2015
@s1monw s1monw added v1.6.0 and removed v1.6.1 labels Jun 3, 2015
s1monw added a commit that referenced this issue Jun 3, 2015
This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes #10262
@s1monw s1monw closed this as completed in 7264fd4 Jun 3, 2015
s1monw added a commit that referenced this issue Jun 3, 2015
This is happening because of #4074 when we required that the top-level "query" is present to delete-by-query requests, but prior to that we required that it is not present. So the translog has a DBQ without "query" and when we try to parse it we hit this exception.

This commit adds special handling for pre 1.0.0 indices if we hit parse exception, we
try to reparse without a top-level query object to be BWC compatible for these indices.

Closes #10262

Conflicts:
	src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
@s1monw s1monw added the >bug label Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants