Skip to content

Improve warning for insufficient file resources for PQ max_bytes (backport #16656)#17249

Merged
donoghuc merged 1 commit into9.0from
mergify/bp/9.0/pr-16656
Mar 5, 2025
Merged

Improve warning for insufficient file resources for PQ max_bytes (backport #16656)#17249
donoghuc merged 1 commit into9.0from
mergify/bp/9.0/pr-16656

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Mar 5, 2025

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


This is an automatic backport of pull request #16656 done by [Mergify](https://mergify.com).

)

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)
@elastic-sonarqube
Copy link
Copy Markdown

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
Copy Markdown

💚 Build Succeeded

@donoghuc donoghuc merged commit 8e42cba into 9.0 Mar 5, 2025
7 checks passed
@donoghuc donoghuc deleted the mergify/bp/9.0/pr-16656 branch March 5, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants