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

Only connect to Elasticsearch instances with the same version or newer #29683

Merged
merged 10 commits into from
Jan 13, 2022

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Jan 4, 2022

What does this PR do?

This PR adds a new callback to all Elasticsearch connections to check if the version is at least the same as the Beat. The check can be disabled by setting the new option output.elasticsearch.allow_older_versions to true.

Why is it important?

By restricting the Elasticsearch versions we can provide optimal experience.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Closes #29264

@kvch kvch requested review from a team as code owners January 4, 2022 17:10
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 4, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 4, 2022

This pull request does not have a backport label. Could you fix it @kvch? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Jan 4, 2022
@kvch kvch changed the title Feature libbeat force version of es Only connect to Elasticsearch instances with the same version or newer Jan 4, 2022
@kvch kvch requested a review from faec January 4, 2022 17:23
@kvch kvch added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jan 4, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 4, 2022
@kvch kvch added the backport-v8.1.0 Automated backport with mergify label Jan 4, 2022
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Jan 4, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 4, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-01-12T16:28:44.619+0000

  • Duration: 154 min 8 sec

  • Commit: f331836

Test stats 🧪

Test Results
Failed 0
Passed 49893
Skipped 4442
Total 54335

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@jlind23 jlind23 requested a review from a team January 5, 2022 09:08
@ruflin
Copy link
Member

ruflin commented Jan 10, 2022

@kvch Is my understanding correct that we can target this against 8.1 as 8.0 does not talk to previous major versions anyways?

kvch and others added 4 commits January 10, 2022 14:50
Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
@kvch
Copy link
Contributor Author

kvch commented Jan 10, 2022

Is my understanding correct that we can target this against 8.1 as 8.0 does not talk to previous major versions anyways?

We target this against 8.1. In 8.0, if someone tries to connect to an older version, we just emit a warning: #29723

@kvch
Copy link
Contributor Author

kvch commented Jan 11, 2022

/test filebeat

@ruflin
Copy link
Member

ruflin commented Jan 12, 2022

@nimarezainia Can we make sure this is also clearly shown in our compatibility matrix?

@kvch Based on your comment, someone could run Beats 8.0 vs ES 7.13 and the user would get a warning. Do we agree that we don't support this?

@kvch
Copy link
Contributor Author

kvch commented Jan 13, 2022

@kvch Based on your comment, someone could run Beats 8.0 vs ES 7.13 and the user would get a warning. Do we agree that we don't support this?

Yes and yes.

@mgevans-5
Copy link

Please confirm this does or does not impact Logstash as the PR only mentions connections to Elasticsearch

@cmacknz
Copy link
Member

cmacknz commented Mar 14, 2022

Please confirm this does or does not impact Logstash as the PR only mentions connections to Elasticsearch

The change only affects Elasticsearch. The only code change here is to the beats Elasticsearch client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.1.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce the fact that you can ship data only to equal or newer version
5 participants