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

Cherry-pick #19518, #19528, #19529, #19530, #19571, #19573 to 7.x: Implement storage handling for cursor inputs #19732

Merged
merged 8 commits into from
Jul 8, 2020

Conversation

urso
Copy link

@urso urso commented Jul 8, 2020

Cherry-pick of PR #19518, #19528, #19529, #19530, #19571, #19573 to 7.x branch. Original message:

  • Enhancement

What does this PR do?

This change provide the store implementation that is used by the cursor
input to track ephemeral and persistent state.

The full list of changes will include:

Why is it important?

Implement support for statefull inputs.

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.

How to test this PR locally

go test

Related issues

This change provide the store implementation that is used by the cursor
input to track ephemeral and persistent state.

The full list of changes will include:
- Introduce v2 API interfaces
- Introduce [compatibility layer](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/compat) to integrate API with existing functionality
- Introduce helpers for writing [stateless](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/input/v2/input-stateless/stateless.go) inputs.
- Introduce helpers for writing [inputs that store a state](https://github.com/urso/beats/tree/fb-input-v2-combined/filebeat/input/v2/input-cursor) between restarts.
- Integrate new API with [existing inputs and modules](https://github.com/urso/beats/blob/fb-input-v2-combined/filebeat/beater/filebeat.go#L301) in filebeat.

(cherry picked from commit 0800ab1)
@urso urso added [zube]: In Review backport Team:Services (Deprecated) Label for the former Integrations-Services team labels Jul 8, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2020
Steffen Siering added 5 commits July 8, 2020 13:20
The change provides the collection and deletion support for old states.
All entries added to the store have a TTL configured. A key-value pair
will be removed from the store once the most recent update timestamp + TTL < now.
Pairs with pending updates will not be deleted yet.

The collector currently only implements the logic for the clean_inactive setting.

In comparison to the old registar, is the TTL not reset on startup. Old
entries are still subject to collection, even if they've not been
claimed. The TTL will be updated by the InputManager if an input with a
different TTL is started for an already seen source.
Stateful inputs can access the current state via the Cursor type.
This change adds unit tests to ensure that the cursor correctly
interacts with the ephemeral and persistent stores.
Add the publisher implementation and unit tests for statefull inputs. The tests check that the publisher correctly updates the ephemeral store and prepare the update operation for the persistent store, that will be applied to the store after it has been ACKed.
This change finally implements the input manager and actual input execution for stateful
inputs.
Add tests for the stateful input manager and inputs.
@urso urso changed the title Cherry-pick #19518 to 7.x: Implement storage handling for cursor inputs Cherry-pick #19518. #19528, #15929, #15930, to 7.x: Implement storage handling for cursor inputs Jul 8, 2020
@urso urso changed the title Cherry-pick #19518. #19528, #15929, #15930, to 7.x: Implement storage handling for cursor inputs Cherry-pick #19518. #19528, #15929, #15930, #15971, #15973 to 7.x: Implement storage handling for cursor inputs Jul 8, 2020
@urso urso changed the title Cherry-pick #19518. #19528, #15929, #15930, #15971, #15973 to 7.x: Implement storage handling for cursor inputs Cherry-pick #19518, #19528, #15929, #15930, #15971, #15973 to 7.x: Implement storage handling for cursor inputs Jul 8, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 8, 2020

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19732 updated]

  • Reason: Aborted from #4

  • Start Time: 2020-07-08T11:59:08.590+0000

  • Duration: 6 min 56 sec

  • Commit: 8d5e880

Log output

Expand to view the last 100 lines of log output

[2020-07-08T12:05:01.812Z] Stage "Build and Test" skipped due to earlier failure(s)
[2020-07-08T12:05:02.011Z] Stage "Elastic Agent x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.013Z] Stage "Elastic Agent x-pack Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.014Z] Stage "Elastic Agent Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.014Z] Stage "Filebeat oss" skipped due to earlier failure(s)
[2020-07-08T12:05:02.015Z] Stage "Filebeat x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.016Z] Stage "Filebeat Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.017Z] Stage "Filebeat x-pack Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.018Z] Stage "Filebeat Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.018Z] Stage "Filebeat x-pack Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.019Z] Stage "Heartbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.020Z] Stage "Auditbeat oss Linux" skipped due to earlier failure(s)
[2020-07-08T12:05:02.020Z] Stage "Auditbeat crosscompile" skipped due to earlier failure(s)
[2020-07-08T12:05:02.021Z] Stage "Auditbeat oss Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.022Z] Stage "Auditbeat oss Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.023Z] Stage "Auditbeat x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.024Z] Stage "Auditbeat x-pack Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.024Z] Stage "Auditbeat x-pack Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.025Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.026Z] Stage "Libbeat x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.026Z] Stage "Metricbeat OSS Unit tests" skipped due to earlier failure(s)
[2020-07-08T12:05:02.027Z] Stage "Metricbeat OSS Integration tests" skipped due to earlier failure(s)
[2020-07-08T12:05:02.028Z] Stage "Metricbeat Python integration tests" skipped due to earlier failure(s)
[2020-07-08T12:05:02.029Z] Stage "Metricbeat x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.029Z] Stage "Metricbeat crosscompile" skipped due to earlier failure(s)
[2020-07-08T12:05:02.030Z] Stage "Metricbeat Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.031Z] Stage "Metricbeat x-pack Mac OS X" skipped due to earlier failure(s)
[2020-07-08T12:05:02.032Z] Stage "Metricbeat Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.033Z] Stage "Metricbeat x-pack Windows" skipped due to earlier failure(s)
[2020-07-08T12:05:02.033Z] Stage "Packetbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.034Z] Stage "dockerlogbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.035Z] Stage "Winlogbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.035Z] Stage "Winlogbeat Windows x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.036Z] Stage "Functionbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.036Z] Stage "Journalbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.037Z] Stage "Generators" skipped due to earlier failure(s)
[2020-07-08T12:05:02.037Z] Stage "Kubernetes" skipped due to earlier failure(s)
[2020-07-08T12:05:02.114Z] Stage "Heartbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.115Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.116Z] Stage "Metricbeat x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.117Z] Stage "Packetbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.118Z] Stage "dockerlogbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.119Z] Stage "Winlogbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.119Z] Stage "Functionbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.120Z] Stage "Journalbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.121Z] Stage "Generators" skipped due to earlier failure(s)
[2020-07-08T12:05:02.610Z] Failed in branch Elastic Agent x-pack
[2020-07-08T12:05:02.611Z] Failed in branch Elastic Agent x-pack Windows
[2020-07-08T12:05:02.612Z] Failed in branch Elastic Agent Mac OS X
[2020-07-08T12:05:02.612Z] Failed in branch Filebeat oss
[2020-07-08T12:05:02.613Z] Failed in branch Filebeat x-pack
[2020-07-08T12:05:02.613Z] Failed in branch Filebeat Mac OS X
[2020-07-08T12:05:02.614Z] Failed in branch Filebeat x-pack Mac OS X
[2020-07-08T12:05:02.615Z] Failed in branch Filebeat Windows
[2020-07-08T12:05:02.615Z] Failed in branch Filebeat x-pack Windows
[2020-07-08T12:05:02.616Z] Failed in branch Auditbeat oss Linux
[2020-07-08T12:05:02.616Z] Failed in branch Auditbeat crosscompile
[2020-07-08T12:05:02.617Z] Failed in branch Auditbeat oss Mac OS X
[2020-07-08T12:05:02.618Z] Failed in branch Auditbeat oss Windows
[2020-07-08T12:05:02.618Z] Failed in branch Auditbeat x-pack
[2020-07-08T12:05:02.619Z] Failed in branch Auditbeat x-pack Mac OS X
[2020-07-08T12:05:02.619Z] Failed in branch Auditbeat x-pack Windows
[2020-07-08T12:05:02.620Z] Failed in branch Libbeat x-pack
[2020-07-08T12:05:02.620Z] Failed in branch Metricbeat OSS Unit tests
[2020-07-08T12:05:02.621Z] Failed in branch Metricbeat OSS Integration tests
[2020-07-08T12:05:02.622Z] Failed in branch Metricbeat Python integration tests
[2020-07-08T12:05:02.622Z] Failed in branch Metricbeat crosscompile
[2020-07-08T12:05:02.623Z] Failed in branch Metricbeat Mac OS X
[2020-07-08T12:05:02.623Z] Failed in branch Metricbeat x-pack Mac OS X
[2020-07-08T12:05:02.624Z] Failed in branch Metricbeat Windows
[2020-07-08T12:05:02.625Z] Failed in branch Metricbeat x-pack Windows
[2020-07-08T12:05:02.625Z] Failed in branch Winlogbeat Windows x-pack
[2020-07-08T12:05:02.626Z] Failed in branch Kubernetes
[2020-07-08T12:05:02.873Z] Stage "Heartbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.874Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.875Z] Stage "Metricbeat x-pack" skipped due to earlier failure(s)
[2020-07-08T12:05:02.876Z] Stage "Winlogbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.877Z] Stage "Functionbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:02.878Z] Stage "Generators" skipped due to earlier failure(s)
[2020-07-08T12:05:02.931Z] Failed in branch Packetbeat
[2020-07-08T12:05:02.932Z] Failed in branch dockerlogbeat
[2020-07-08T12:05:02.933Z] Failed in branch Journalbeat
[2020-07-08T12:05:03.121Z] Stage "Heartbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:03.123Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:03.124Z] Stage "Functionbeat" skipped due to earlier failure(s)
[2020-07-08T12:05:03.125Z] Stage "Generators" skipped due to earlier failure(s)
[2020-07-08T12:05:03.161Z] Failed in branch Metricbeat x-pack
[2020-07-08T12:05:03.161Z] Failed in branch Winlogbeat
[2020-07-08T12:05:03.328Z] Failed in branch Heartbeat
[2020-07-08T12:05:03.329Z] Failed in branch Libbeat
[2020-07-08T12:05:03.330Z] Failed in branch Functionbeat
[2020-07-08T12:05:03.331Z] Stage "Generators" skipped due to earlier failure(s)
[2020-07-08T12:05:03.402Z] Failed in branch Generators
[2020-07-08T12:05:03.690Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19732
[2020-07-08T12:05:03.792Z] [INFO] getVaultSecret: Getting secrets
[2020-07-08T12:05:03.855Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-08T12:05:04.593Z] + chmod 755 generate-build-data.sh
[2020-07-08T12:05:04.593Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19732/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19732/runs/3 ABORTED 355742
[2020-07-08T12:05:04.593Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19732/runs/3/steps/?limit=10000 -o steps-info.json
[2020-07-08T12:05:04.844Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19732/runs/3/tests/?status=FAILED -o tests-errors.json

@urso urso changed the title Cherry-pick #19518, #19528, #15929, #15930, #15971, #15973 to 7.x: Implement storage handling for cursor inputs Cherry-pick #19518, #19528, #19529, #19530, #19571, #19573 to 7.x: Implement storage handling for cursor inputs Jul 8, 2020
@urso urso merged commit 56d4dd0 into elastic:7.x Jul 8, 2020
@urso urso deleted the backport_19518_7.x branch July 8, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Services (Deprecated) Label for the former Integrations-Services team [zube]: Done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants