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

index sorting yaml test fails against multiple nodes #24416

Closed
javanna opened this issue May 1, 2017 · 5 comments
Closed

index sorting yaml test fails against multiple nodes #24416

javanna opened this issue May 1, 2017 · 5 comments
Assignees
Labels
>test Issues or PRs that are addressing/adding tests >test-failure Triaged test failures from CI

Comments

@javanna
Copy link
Member

javanna commented May 1, 2017

Link to the failure: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+multijob-intake/1160 .

Despite setting the index to be sorted on the rank field, it seems like the results are not properly sorted.

> Throwable #1: java.lang.AssertionError: Failure at [indices.sort/10_basic:72]: hits.hits.0._id didn't match expected value:
   >                hits.hits.0._id: expected [2] but was [3]
   > 	at __randomizedtesting.SeedInfo.seed([E5B9D8E6C696CADE:6DEDE73C686AA726]:0)
   > 	at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.executeSection(ESClientYamlSuiteTestCase.java:346)
   > 	at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.test(ESClientYamlSuiteTestCase.java:326)
   > 	at java.lang.Thread.run(Thread.java:748)
   > Caused by: java.lang.AssertionError: hits.hits.0._id didn't match expected value:
   >                hits.hits.0._id: expected [2] but was [3]
   > 	at org.elasticsearch.test.rest.yaml.section.MatchAssertion.doAssert(MatchAssertion.java:87)
   > 	at org.elasticsearch.test.rest.yaml.section.Assertion.execute(Assertion.java:76)
   > 	at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.executeSection(ESClientYamlSuiteTestCase.java:342)
   > 	... 37 more
@javanna javanna added >test-failure Triaged test failures from CI >test Issues or PRs that are addressing/adding tests labels May 1, 2017
@jimczi jimczi closed this as completed in 6fcd24d May 2, 2017
jasontedor added a commit to jasontedor/elasticsearch that referenced this issue May 2, 2017
* master: (27 commits)
  Check index sorting with no replica since we cannot ensure that the replica index is ready when forceMerge is called. Closes elastic#24416
  Docs: correct indentation on callout
  Build that java api docs from a test (elastic#24354)
  Move RemoteClusterService into TransportService (elastic#24424)
  Fix license header in WildflyIT.java
  Try not to lose stacktraces (elastic#24426)
  [DOCS] Update XPack Reference URL for 5.4 (elastic#24425)
  Painless: Add tests to check for existence and correct detection of the special Java 9 optimizations: Indified String concat and MethodHandles#ArrayLengthHelper() (elastic#24405)
  Extract a common base class to allow services to listen to remote cluster config updates (elastic#24367)
  Adds check to snapshot repository incompatible-snapshots blob to delete a pre-existing one before attempting to overwrite it.
  Added docs for batched_reduce_size
  Fixes checkstyle errors
  Allow scripted metric agg to access `_score` (elastic#24295)
  [Test] Add unit tests for HDR/TDigest PercentilesAggregators (elastic#24245)
  Fix FieldCaps documentation
  Upgrade to JUnit 4.12 (elastic#23877)
  Set available processors for Netty
  Painless: Fix method references to ctor with the new LambdaBootstrap and cleanup code (elastic#24406)
  Doc test: use propery regex for file size
  [DOCS] Tweak doc test to sync_flush
  ...
@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Feb 8, 2018

The index sorting test still fails elastic/elasticsearch 6.x 2018-02-08T16:40:51.597Z:

Failure at [indices.sort/10_basic:143]: hits.hits.6._id didn't match expected value:
hits.hits.6._id: expected [8] but was [5]

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.x+oracle-java9-periodic/69/console
REPRODUCE WITH:

./gradlew :qa:smoke-test-multinode:integTestRunner \
  -Dtests.seed=FBD2C92E4D563B0 \
  -Dtests.class=org.elasticsearch.smoketest.SmokeTestMultiNodeClientYamlTestSuiteIT \
  -Dtests.method="test {yaml=indices.sort/10_basic/Index Sort}" \
  -Dtests.security.manager=true \
  -Dtests.locale=en-RW \
  -Dtests.timezone=America/Indiana/Indianapolis

@jimczi I have noticed that that you reverted back : number_of_replicas: 1 here. Is there a reason to have it to be equal to 1 and not 0? It seems that the test fails because of number_of_replicas is 1

@javanna
Copy link
Member Author

javanna commented Feb 9, 2018

@mayya-sharipova were you able to repro with the seed? I've seen a similar failure also on master (https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+oracle-java10-periodic/61) yet I can not repro on any branch with any seed.

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Feb 9, 2018

@javanna I was not able to reproduce it on my local machine. I guess the test fails when replica lags behind the main shard in updating docs.

@romseygeek
Copy link
Contributor

I think what is happening here is that the indexing and then force-merge on the master are not necessarily being replayed in exactly the same order on the replica, and so instead of ending up with a single sorted segment, we have two segments, the second of which only contains document 8. Although there's a refresh and two searches in between the last index and the force-merge, so how the reordering is happening isn't obvious.

We can stick a few extra flush or refresh commands in there to ensure that everything is in the correct order. Or as @mayya-sharipova suggested, we could just make the test a 0-replica test, as it doesn't really add anything to have a replica here?

@jimczi jimczi closed this as completed in 37e938f Feb 12, 2018
jimczi added a commit that referenced this issue Feb 12, 2018
Set the number of replicas to 0 in order to avoid race condition during the test
Fixes #24416
jimczi added a commit that referenced this issue Feb 12, 2018
Set the number of replicas to 0 in order to avoid race condition during the test
Fixes #24416
jimczi added a commit that referenced this issue Feb 12, 2018
Set the number of replicas to 0 in order to avoid race condition during the test
Fixes #24416
jimczi added a commit that referenced this issue Feb 12, 2018
Set the number of replicas to 0 in order to avoid race condition during the test
Fixes #24416
@jimczi
Copy link
Contributor

jimczi commented Feb 12, 2018

Thanks for investigating @javanna @mayya-sharipova @romseygeek
I pushed a fix to set the number of replicas to 0, I agree that it doesn't add anything to have replicas in this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test Issues or PRs that are addressing/adding tests >test-failure Triaged test failures from CI
Projects
None yet
Development

No branches or pull requests

4 participants