Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Add Disk Queue configuration #138

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

leehinman
Copy link
Contributor

@leehinman leehinman commented Oct 17, 2022

What does this PR do?

In configuration file we will have:

queue:
  disk:
    path:
    max_size:
    segment_size:
    read_ahead:
    write_ahead:
    retry_interval:
    max_retry_interval:
    encryption_password:
    use_compression:

These are the same as beats except for
use_compression, and encryption_password. Which are new to
support encryption & compression.

Why is it important?

Need to be able to configure the disk queue to use it in the shipper.

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.md or CHANGELOG-developer.md.

How to test this PR locally

mage integrationTest

Related issues

@leehinman leehinman requested a review from a team as a code owner October 17, 2022 17:59
@leehinman leehinman requested review from cmacknz and fearful-symmetry and removed request for a team October 17, 2022 17:59
@mergify
Copy link
Contributor

mergify bot commented Oct 17, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b 119_disk_queue_configuration upstream/119_disk_queue_configuration
git merge upstream/main
git push upstream 119_disk_queue_configuration

@mergify
Copy link
Contributor

mergify bot commented Oct 17, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @leehinman? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@leehinman leehinman added enhancement New feature or request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Oct 17, 2022
- runs server in stand alone mode
- checks that server starts
- checks that it fails to start with bad config
- checks that a message can be published and is written to output
@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 17, 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-10-25T15:27:34.226+0000

  • Duration: 12 min 45 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

@leehinman leehinman force-pushed the 119_disk_queue_configuration branch 2 times, most recently from 3663b99 to b402062 Compare October 18, 2022 13:41
- config options taken from beats
- add `use_compression` options
- add `use_encryption` option
- add `encryption_password` option for stand alone and testing,
  elastic-agent use case will query for encryption key (to do).

Closes elastic#119
@leehinman leehinman requested a review from faec October 18, 2022 15:25
@pierrehilbert pierrehilbert removed the request for review from faec October 19, 2022 12:13
Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

Generally looks good, a few questions about tests and how we should get the encryption key.

Please review elastic/elastic-agent#1527 and make sure the configuration there is in sync with this one. Likely this we have another variant of the shared configuration problem between the agent and the shipper, where we have no way to guarantee the two configs stay in sync yet.

queue/config.go Outdated Show resolved Hide resolved
queue/queue_test.go Show resolved Hide resolved
integration/integration_test.go Outdated Show resolved Hide resolved
queue/config.go Show resolved Hide resolved
"string": unique,
"number": 42,
events, err := createEvents([]string{unique})
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be best to use the "github.com/stretchr/testify/require" library we use everywhere else; will clean up the tests at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reworked with require, also added an environment Fatalf, so when the test fails you see the stdout & stderr so you have some idea what happened.

Fields: sampleValues,
}
events := []*messages.Event{e}
client, err := env.NewClient("localhost:50052")
Copy link
Contributor

Choose a reason for hiding this comment

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

A little worried that the hard-coded ports are going to collide with something, but it looks like the rest of the tests already do that, so unless you're particularly interested in modifying the framework to assign random free ports, that's probably a task for another day.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it is a risk. Going to wait and see if it is a problem. If it is, my guess is we should move to Docker for starting the Shipper.

@leehinman leehinman merged commit 5a56a16 into elastic:main Oct 27, 2022
@leehinman leehinman deleted the 119_disk_queue_configuration branch October 27, 2022 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request 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.

add disk queue configuration to shipper configuration
5 participants