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

ActionRequestValidationException on deleteIndex() during beforeEach() #40

Merged
merged 4 commits into from
Apr 26, 2014

Conversation

martinb3
Copy link
Contributor

Hello --

I'm noticing the following in IndexCrud.scala:

trait DeleteIndex {
  self: Indexer =>
  def deleteIndex(indices: Iterable[String] = Nil, timeout: Option[String] = None) = deleteIndex_send(indices, timeout).actionGet
  def deleteIndex_send(indices: Iterable[String] = Nil, timeout: Option[String] = None) = deleteIndex_prepare(indices, timeout).execute
  def deleteIndex_prepare(indices: Iterable[String] = Nil, timeout: Option[String] = None) = {
    val request = client.admin.indices.prepareDelete(indices.toArray: _*)
    timeout foreach { request.setTimeout(_) }
    request
  }

  /** caveat: if none of the indices exists, we will encounter a validation exception */
  def deleteIndexIfExists(indices: Iterable[String] = Nil, timeout: Option[String] = None) = deleteIndexIfExists_send(indices, timeout).actionGet
  def deleteIndexIfExists_send(indices: Iterable[String] = Nil, timeout: Option[String] = None) = deleteIndexIfExists_prepare(indices, timeout).execute
  def deleteIndexIfExists_prepare(indices: Iterable[String] = Nil, timeout: Option[String] = None) = {
    val existing = indices filter (exists(_).isExists)
    val toDelete: Iterable[String] = if (existing.isEmpty) null else existing
    deleteIndex_prepare(toDelete, timeout)
  }
}

How are these tests ever passing if they throw an exception on delete() when I'm starting from scratch with no indexes? Are you doing some special prep step that I'm not catching?

Here's the exception:

org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: index / indices is missing;

Thank you,

Martin

@martinb3 martinb3 changed the title Caveat: if none of the indices exists, we will encounter a validation exception ActionRequestValidationException on deleteIndex() during beforeEach() Apr 11, 2014
@martinb3
Copy link
Contributor Author

Just a note -- I do think some of this is related to bumping the version of Elasticsearch. However, even going back to your upstream version, I get a lot of failures like:

[info] SpecificMasterNodesTests:
[info] - simpleOnlyMasterNodeElection *** FAILED ***
[info]   org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]
[info]   at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:180)
[info]   at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:483)
[info]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[info]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[info]   at java.lang.Thread.run(Thread.java:744)
[info]   ...

[info] FullRollingRestartTests:
[info] - testFullRollingRestart *** FAILED ***
[info]   true did not equal false (FullRollingRestartTests.scala:15)
[info] IndicesStoreTests:
[info] - shardsCleanup *** FAILED ***
[info]   false did not equal true (IndicesStoreTests.scala:23)

etc.

@martinb3
Copy link
Contributor Author

Hello! I found just adding some delays at specific tests that are doing recovery caused all tests to pass. These commits make all tests pass for me. Thank you! - Martin

@bsadeh
Copy link
Owner

bsadeh commented Apr 21, 2014

yes, it might be cpu dependent. i'm pretty sure it didn't fail for me
before on my laptop.
glad you figured out a fix :-)

On Mon, Apr 21, 2014 at 8:09 PM, Martin Smith notifications@github.comwrote:

Hello! I found just adding some delays at specific tests that are doing
recovery caused all tests to pass. These commits make all tests pass for
me. Thank you! - Martin


Reply to this email directly or view it on GitHubhttps://github.com//pull/40#issuecomment-40953270
.

@martinb3
Copy link
Contributor Author

Would you mind merging these changes in? Thanks! - Martin

bsadeh added a commit that referenced this pull request Apr 26, 2014
ActionRequestValidationException on deleteIndex() during beforeEach()
@bsadeh bsadeh merged commit 636b12f into bsadeh:master Apr 26, 2014
@bsadeh
Copy link
Owner

bsadeh commented Apr 26, 2014

I did merge the last pull request Martin, but I can't release while I
travel.
3 more weeks ...

On Sat, Apr 26, 2014 at 10:26 PM, Martin Smith notifications@github.comwrote:

Would you mind merging these changes in? Thanks! - Martin


Reply to this email directly or view it on GitHubhttps://github.com//pull/40#issuecomment-41478222
.

@martinb3
Copy link
Contributor Author

Thanks! No problem about the release, as I'm only running tests from source :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants