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

PMM-12896 Add limit for actions/jobs executed on the same DB at the same time #2898

Merged
merged 35 commits into from
May 22, 2024

Conversation

artemgavrilov
Copy link
Contributor

@artemgavrilov artemgavrilov commented Mar 13, 2024

PMM-12896

Link to the Feature Build: SUBMODULES-3588

@artemgavrilov artemgavrilov changed the title [PMM-12896] Add limit for actions/jobs executed on the same DB at the same time PMM-12896 Add limit for actions/jobs executed on the same DB at the same time Mar 13, 2024
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 57.43945% with 123 lines in your changes are missing coverage. Please review.

Project coverage is 41.80%. Comparing base (b4a4c6d) to head (256c8b1).
Report is 2 commits behind head on main.

Files Patch % Lines
agent/runner/jobs/pbm_helpers.go 0.00% 25 Missing ⚠️
agent/runner/runner.go 86.25% 12 Missing and 6 partials ⚠️
agent/client/client.go 6.25% 15 Missing ⚠️
agent/runner/jobs/mongodb_backup_job.go 20.00% 8 Missing ⚠️
agent/runner/actions/mongodb_explain_action.go 50.00% 4 Missing and 1 partial ⚠️
...unner/actions/mongodb_query_admincommand_action.go 44.44% 4 Missing and 1 partial ⚠️
...t/runner/actions/postgresql_query_select_action.go 58.33% 4 Missing and 1 partial ⚠️
...ent/runner/actions/postgresql_query_show_action.go 50.00% 4 Missing and 1 partial ⚠️
...ner/actions/postgresql_show_create_table_action.go 50.00% 4 Missing and 1 partial ⚠️
...ent/runner/actions/postgresql_show_index_action.go 50.00% 4 Missing and 1 partial ⚠️
... and 12 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2898      +/-   ##
==========================================
- Coverage   43.28%   41.80%   -1.48%     
==========================================
  Files         399      397       -2     
  Lines       41394    48489    +7095     
==========================================
+ Hits        17916    20272    +2356     
- Misses      21477    26213    +4736     
- Partials     2001     2004       +3     
Flag Coverage Δ
agent 52.83% <57.43%> (+0.15%) ⬆️

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.

@artemgavrilov artemgavrilov marked this pull request as ready for review March 15, 2024 16:38
@artemgavrilov artemgavrilov requested a review from a team as a code owner March 15, 2024 16:38
@artemgavrilov artemgavrilov requested review from idoqo and JiriCtvrtka and removed request for a team March 15, 2024 16:38
Copy link
Member

@BupycHuk BupycHuk left a comment

Choose a reason for hiding this comment

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

Do we really need to limit connections for any other DB types except PostgreSQL? Does it affect other DBs the same way as it does for PostgreSQL. I'm affraid of doing more harm then providing advantage with these changes.

agent/runner/actions/mongodb_explain_action.go Outdated Show resolved Hide resolved
agent/runner/actions/mysql_explain_action_test.go Outdated Show resolved Hide resolved
agent/runner/actions/mysql_explain_action_test.go Outdated Show resolved Hide resolved
agent/runner/runner.go Outdated Show resolved Hide resolved
agent/runner/runner.go Show resolved Hide resolved
agent/runner/runner_test.go Show resolved Hide resolved
agent/runner/runner_test.go Outdated Show resolved Hide resolved
agent/runner/runner_test.go Outdated Show resolved Hide resolved
@artemgavrilov
Copy link
Contributor Author

Do we really need to limit connections for any other DB types except PostgreSQL? Does it affect other DBs the same way as it does for PostgreSQL. I'm affraid of doing more harm then providing advantage with these changes.

MySQL and MongoDB don't have such problems with connections as PostgreSQL, but it may be still an issue. For example MySQL by default allows 151 connections. So having some limits on our side sounds like a good idea. Moreover with this change we can say exactly how many connections do we need. But I'm agree that we need to test that overall user experience is still good.

Copy link
Member

@BupycHuk BupycHuk left a comment

Choose a reason for hiding this comment

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

Looks good to me

agent/runner/runner.go Show resolved Hide resolved
agent/config/config.go Outdated Show resolved Hide resolved
agent/runner/actions/mongodb_explain_action.go Outdated Show resolved Hide resolved
agent/runner/actions/mysql_explain_action.go Outdated Show resolved Hide resolved
agent/runner/actions/mysql_explain_action.go Outdated Show resolved Hide resolved
agent/runner/actions/mysql_explain_action.go Outdated Show resolved Hide resolved
agent/runner/actions/postgresql_query_select_action.go Outdated Show resolved Hide resolved
@BupycHuk BupycHuk merged commit 09f3823 into main May 22, 2024
19 of 22 checks passed
@BupycHuk BupycHuk deleted the PMM-12896-limit-conns-num-from-jobs-runner branch May 22, 2024 10:22
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.

5 participants