Skip to content

PMM-13794 fix pmm agent on pmm server #4032

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

Open
wants to merge 6 commits into
base: v3
Choose a base branch
from

Conversation

BupycHuk
Copy link
Member

PMM-13794

Link to the Feature Build: SUBMODULES-3927

If this PR adds or removes or alters one or more API endpoints, please review and add or update the relevant API documents as well:

  • API Docs updated

If this PR is related to some other PRs in this or other repositories, please provide links to those PRs:

  • Links to related pull requests (optional).

BupycHuk added 3 commits May 19, 2025 09:53
Introduce goroutines and mutexes to improve concurrency handling in HA services. Added safeguards to ensure thread-safe operations and improved logging for better traceability. This ensures smoother service start/stop processes and handles errors more gracefully.
Introduce goroutines and mutexes to improve concurrency handling in HA services. Added safeguards to ensure thread-safe operations and improved logging for better traceability. This ensures smoother service start/stop processes and handles errors more gracefully.
@BupycHuk BupycHuk requested a review from a team as a code owner May 19, 2025 12:19
@BupycHuk BupycHuk requested review from idoqo and JiriCtvrtka and removed request for a team May 19, 2025 12:19
Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 5.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 42.97%. Comparing base (f9d9b5f) to head (26988e0).
Report is 4 commits behind head on v3.

Files with missing lines Patch % Lines
managed/cmd/pmm-managed/main.go 0.00% 6 Missing ⚠️
managed/services/ha/services.go 0.00% 6 Missing ⚠️
managed/services/ha/leaderservice.go 0.00% 4 Missing ⚠️
managed/services/ha/highavailability.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v3    #4032      +/-   ##
==========================================
- Coverage   43.68%   42.97%   -0.71%     
==========================================
  Files         369      369              
  Lines       45165    45232      +67     
==========================================
- Hits        19731    19440     -291     
- Misses      23729    24116     +387     
+ Partials     1705     1676      -29     
Flag Coverage Δ
admin 11.49% <ø> (+0.04%) ⬆️
agent 50.07% <ø> (-2.66%) ⬇️
vmproxy 73.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -56,7 +56,7 @@
host: 127.0.0.1
port: 5432
timeout: 150
when: lookup('env','PMM_POSTGRES_ADDR') == '127.0.0.1:5432' and lookup('env','PMM_DISABLE_BUILTIN_POSTGRES') != '1'
when: lookup('env','GF_DATABASE_URL') == '' and lookup('env','GF_DATABASE_HOST') == '' and lookup('env','PMM_DISABLE_BUILTIN_POSTGRES') == ''
Copy link
Member

Choose a reason for hiding this comment

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

What if the user sets PMM_DISABLE_BUILTIN_POSTGRES to 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

it will be very weird decission 😊, but this solution is easier to support then multiple variations of True value

Copy link
Member

Choose a reason for hiding this comment

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

Well, there is a better way, as usual. For example, we could solve it with the following syntax:

    when: 
      - lookup('env','GF_DATABASE_URL') == '' 
      - lookup('env','GF_DATABASE_HOST') == '' 
      - not (lookup('env','PMM_DISABLE_BUILTIN_POSTGRES') | bool)

Moved high-availability (HA) configuration to a new docker-compose.ha.yml file, isolating it from the default compose file. This improves maintainability and provides a cleaner separation between standard and HA setups.
@BupycHuk BupycHuk requested a review from ademidoff May 19, 2025 14:20
Added environment variables, healthchecks, and better dependency conditions for services to enhance reliability. Adjusted network ports, volumes, and configurations for PostgreSQL and ClickHouse. Deprecated unused parameters and ensured compatibility with multi-platform builds.
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.

3 participants