Skip to content

TSDB: Fix RollupActionSingleNodeTests failing with IndexNotFoundException#87333

Merged
csoulios merged 2 commits intoelastic:masterfrom
csoulios:fix-69799
Jun 3, 2022
Merged

TSDB: Fix RollupActionSingleNodeTests failing with IndexNotFoundException#87333
csoulios merged 2 commits intoelastic:masterfrom
csoulios:fix-69799

Conversation

@csoulios
Copy link
Copy Markdown
Contributor

@csoulios csoulios commented Jun 2, 2022

Looks like the failure reported at #69799 (comment) happens because of randomly generated index names conflict between two tests.

  • Add more random numbers to test names, so that the probability of conflicts is negligible
  • Generate source and rollup index names more carefully so that they are logged properly.
  • Cleanup test code

Fixes #69799

@csoulios csoulios added >test Issues or PRs that are addressing/adding tests :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data auto-backport-and-merge v8.4.0 v8.3.1 labels Jun 2, 2022
@csoulios csoulios requested a review from not-napoleon June 2, 2022 16:26
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jun 2, 2022
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

// A duplicate event was created by random generator. We should not fail for this
// reason.
logger.info("We tried to insert a duplicate: " + response.getFailureMessage());
logger.debug("We tried to insert a duplicate: [{}]", response.getFailureMessage());
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am changing this to debug level so that it does not flood the logs

Comment on lines +115 to +116
sourceIndex = randomAlphaOfLength(12).toLowerCase(Locale.ROOT);
rollupIndex = "rollup-" + sourceIndex + "-" + randomAlphaOfLength(4).toLowerCase(Locale.ROOT);
Copy link
Copy Markdown
Contributor Author

@csoulios csoulios Jun 2, 2022

Choose a reason for hiding this comment

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

Making the source index 12 chars long make it extremely impossible to hit a conflict.
Also, changed the rollup index name so that it cannot conflict with source index name.
Bonus, it's easy to tell which index is the source and which is is the rollup index from the logs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about getTestName()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that's should work too, I guess

* @return the name of the source index clone
*/
private String cloneSourceIndex(String sourceIndex) {
String sourceIndexClone = "clone-" + sourceIndex;
Copy link
Copy Markdown
Contributor Author

@csoulios csoulios Jun 2, 2022

Choose a reason for hiding this comment

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

sourceIndexClone was an instance variable initialized at the test setup().

Now it's been generated here making it more explicit

Copy link
Copy Markdown
Member

@not-napoleon not-napoleon left a comment

Choose a reason for hiding this comment

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

LGTM

@csoulios csoulios merged commit f74d68c into elastic:master Jun 3, 2022
@csoulios csoulios deleted the fix-69799 branch June 3, 2022 16:51
csoulios added a commit to csoulios/elasticsearch that referenced this pull request Jun 3, 2022
…tion (elastic#87333)

Looks like the failure reported at elastic#69799 (comment) happens because of
randomly generated index names conflict between two tests.

    Add more random numbers to test names, so that the probability of conflicts is negligible
    Generate source and rollup index names more carefully so that they are logged properly.
    Cleanup test code

Fixes elastic#69799
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
8.3

elasticsearchmachine pushed a commit that referenced this pull request Jun 3, 2022
…tion (#87333) (#87384)

Looks like the failure reported at #69799 (comment) happens because of
randomly generated index names conflict between two tests.

    Add more random numbers to test names, so that the probability of conflicts is negligible
    Generate source and rollup index names more carefully so that they are logged properly.
    Cleanup test code

Fixes #69799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.3.1 v8.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Various RollupActionSingleNodeTests failing with IndexNotFoundException

5 participants