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

Adjust SearchableSnapshotsLicenseIntegTests.testShardAllocationOnInvalidLicense #77757

Merged

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Sep 15, 2021

This tests sometimes fails because it expects the last PostStartTrialRequest to always "upgrade" the current license that it just nullified to a trial license; but there is a race in this test with the LicenceService that detects that no license exists in the cluster state (because the test set it to null) and self generates a trial license for the cluster too. When the self generation is processed before the PostStartTrialRequest the latter will return a TRIAL_ALREADY_ACTIVATED response.

The debug logging traced added in #74621 where helpful to see this when the tests failed again:

[2021-09-10T15:18:51,501][DEBUG][o.e.l.StartupSelfGeneratedLicenseTask] [node_t0] registered self generated license: LicensesMetadata{license={"uid":"81449fd8-b5c3-4d99-8753-51670b1ed714","type":"trial","issue_date_in_millis":1631265531294,"expiry_date_in_millis":1633857531294,"max_nodes":1000,"max_resource_units":null,"issued_to":"TEST-TEST_WORKER_VM=[466]-CLUSTER_SEED=[-4911272504214133699]-HASH=[F1FC0E4CD7]-cluster","issuer":"elasticsearch","signature":"...,"start_date_in_millis":-1}, trialVersion=8.0.0}

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes #72329

…lidLicense

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes elastic#72329
@tlrx tlrx added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.16.0 v7.15.1 labels Sep 15, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team (obsolete) label Sep 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM makes sense :)

@tlrx tlrx added the v7.14.3 label Sep 15, 2021
@tlrx tlrx merged commit aa50253 into elastic:master Sep 15, 2021
@tlrx
Copy link
Member Author

tlrx commented Sep 15, 2021

Thanks Armin!

tlrx added a commit to tlrx/elasticsearch that referenced this pull request Sep 15, 2021
…lidLicense (elastic#77757)

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes elastic#72329
tlrx added a commit to tlrx/elasticsearch that referenced this pull request Sep 15, 2021
…lidLicense (elastic#77757)

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes elastic#72329
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
7.x
7.15
7.14

tlrx added a commit to tlrx/elasticsearch that referenced this pull request Sep 15, 2021
…lidLicense (elastic#77757)

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes elastic#72329
@tlrx tlrx deleted the adjust-SearchableSnapshotsLicenseIntegTests branch September 15, 2021 12:32
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…lidLicense (#77757) (#77761)

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes #72329
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…lidLicense (#77757) (#77760)

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes #72329
elasticsearchmachine pushed a commit that referenced this pull request Sep 15, 2021
…lidLicense (#77757) (#77759)

This tests sometimes fails because it expects the last PostStartTrialRequest
to always "upgrade" the current license that it just nullified to a trial
license; but there is a race in this test with the LicenceService that detects
that no license exists in the cluster state (because the test set it to null)
and self generates a trial license for the cluster too. When the self generation
is processed before the PostStartTrialRequest the latter will return a
TRIAL_ALREADY_ACTIVATED response.

Since the purpose of this test is to verify that the searchable snapshot shards
failed when the license change and came back when the trial license if activated
again, I think we can just adjust the test to accommodate for the 2 types of
responses.

Closes #72329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Meta label for distributed team (obsolete) >test Issues or PRs that are addressing/adding tests v7.14.3 v7.15.1 v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SearchableSnapshotsLicenseIntegTests.testShardAllocationOnInvalidLicense fails when recreating its license
5 participants