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

Improve warning for insufficient file resources for PQ max_bytes #16656

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

donoghuc
Copy link
Member

@donoghuc donoghuc commented Nov 7, 2024

Release notes

[Release Notes] Improve warning message for insufficient disk space when configuring persistent queues for pipelines.

What does this PR do?

This commit refactors the PersistedQueueConfigValidator class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
#14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.

Why is it important/What is the impact to the user?

The user will now have a much more detailed and accurate warning they can meaninfully take action with. Here is an example output (as generated using test mocks in the unit tests)

Persistent queues require more disk space than is available on multiple filesystems:

Filesystem 'disk1':
- Total space required: 600gb
- Currently free space: 100gb
- Current PQ usage: 80gb
- Additional space needed: 520gb

Individual queue requirements:
  /var/folders/cw/q_xjr4md1wj_w_c1xwfrnxdw0000gn/T/studtmp-62dcd546c57212e54f73ac3c9d0ed599ce41b9e534c3eb57f22d326bb4e8/main:
    Current size: 30gb
    Maximum size: 300gb
  /var/folders/cw/q_xjr4md1wj_w_c1xwfrnxdw0000gn/T/studtmp-62dcd546c57212e54f73ac3c9d0ed599ce41b9e534c3eb57f22d326bb4e8/secondary:
    Current size: 50gb
    Maximum size: 300gb

Filesystem 'disk2':
- Total space required: 300gb
- Currently free space: 50gb
- Current PQ usage: 25gb
- Additional space needed: 275gb

Individual queue requirements:
  /var/folders/cw/q_xjr4md1wj_w_c1xwfrnxdw0000gn/T/studtmp-c8a3ca76784464d59b207b16b96b7557e6e28943c31f3bf16f6133b3a775/third:
    Current size: 25gb
    Maximum size: 300gb

Please either:
1. Free up disk space
2. Reduce queue.max_bytes in your pipeline configurations
3. Move PQ storage to a filesystem with more available space
Note: Logstash may fail to start if this is not resolved.

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 (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

The unit tests should cover the basics, though i've extensively stubbed the filesystem I will be looking at standing this up in a real build.

Related issues

Use cases

Screenshots

Logs

@donoghuc
Copy link
Member Author

donoghuc commented Nov 7, 2024

TODO:
- Linting (didnt want to distract from the actual changes yet)

  • Figure out other process stuff... Labels, PR templates etc
  • Build logstash and give it a real configuration instead of mocking everything in rspec tests

@donoghuc donoghuc force-pushed the GH-14839-disk-usage branch from 557a159 to 9b408b4 Compare November 8, 2024 20:50
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@donoghuc donoghuc marked this pull request as ready for review November 8, 2024 21:53
Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

Review left in wrong PR 🤦

Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

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

This is a fantastic usability improvement, and well-covered in tests.

LGTM 👍🏼

Copy link

mergify bot commented Mar 4, 2025

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

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

Copy link

mergify bot commented Mar 4, 2025

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Mar 4, 2025
@yaauie yaauie added the backport-9.0 Automated backport to the 9.0 branch with mergify label Mar 4, 2025
This commit refactors the `PersistedQueueConfigValidator` class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
elastic#14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.
@donoghuc donoghuc force-pushed the GH-14839-disk-usage branch from 9b408b4 to 9013a1f Compare March 4, 2025 18:41
@donoghuc
Copy link
Member Author

donoghuc commented Mar 4, 2025

Thanks for the review! I just rebased and force pushed just to see it run in CI given its pretty old now 😅

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@donoghuc
Copy link
Member Author

donoghuc commented Mar 4, 2025

Tests are green.

@donoghuc donoghuc merged commit 0621544 into elastic:main Mar 4, 2025
9 checks passed
mergify bot pushed a commit that referenced this pull request Mar 4, 2025
)

This commit refactors the `PersistedQueueConfigValidator` class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
#14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.

(cherry picked from commit 0621544)
donoghuc added a commit that referenced this pull request Mar 5, 2025
) (#17222)

This commit refactors the `PersistedQueueConfigValidator` class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
#14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.

(cherry picked from commit 0621544)

Co-authored-by: Cas Donoghue <[email protected]>
@donoghuc
Copy link
Member Author

donoghuc commented Mar 5, 2025

@Mergifyio backport 9.0

Copy link

mergify bot commented Mar 5, 2025

backport 9.0

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Mar 5, 2025
)

This commit refactors the `PersistedQueueConfigValidator` class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
#14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.

(cherry picked from commit 0621544)
donoghuc added a commit that referenced this pull request Mar 5, 2025
) (#17249)

This commit refactors the `PersistedQueueConfigValidator` class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
#14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.

(cherry picked from commit 0621544)

Co-authored-by: Cas Donoghue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-9.0 Automated backport to the 9.0 branch with mergify enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning Message when insufficient space to hold multiple persistent queues on a file system could be clearer
4 participants