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

feat: support dynamic reload selected parameters policy (#6741) #6742

Conversation

sophon-zt
Copy link
Contributor

@sophon-zt sophon-zt commented Mar 5, 2024

This is an API addition (e.g., DynamicParameterSelectedPolicy) built on top of Patroni's support for dynamicAction and restartAction. The context is as follows:
Patroni's dynamic configuration parameters for PostgreSQL do not need to include static change parameters, as static and dynamic changes follow different logic. In contrast, Oceanbase (OB) requires all parameters to be changed via SQL. For example, if a user changes two parameters, such as config_key1=abcd and config_key2=1234; config_key1 is a static parameter requiring a restart, while config_key2 is a dynamic parameter.
For Patroni's dynamic update (DynamicAction): only config_key2=1234 can be executed during a dynamic change. However, for OB, both config_key1 and config_key2 need to be changed via SQL, followed by a pod restart.

Therefore, a new field, DynamicParameterSelectedPolicy, is added to differentiate these two scenarios and how to choose the parameter list for DynamicAction: whether to select [config_key2] or both [config_key1, config_key2].
If DynamicParameterPolicy = all, all updated parameters execute DynamicAction.
If DynamicParameterPolicy = dynamic, only parameters listed in DynamicParameters will execute DynamicAction.

@sophon-zt sophon-zt linked an issue Mar 5, 2024 that may be closed by this pull request
@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Mar 5, 2024
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

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

Project coverage is 66.51%. Comparing base (a2fb88c) to head (120986e).
Report is 5 commits behind head on main.

❗ Current head 120986e differs from pull request most recent head 9169c83. Consider uploading reports for the commit 9169c83 to get more accurate results

Files Patch % Lines
apis/apps/v1alpha1/configconstraint_types.go 0.00% 8 Missing ⚠️
...ntrollers/apps/configuration/reconfigure_policy.go 14.28% 6 Missing ⚠️
...trollers/apps/configuration/sync_upgrade_policy.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6742      +/-   ##
==========================================
- Coverage   66.52%   66.51%   -0.02%     
==========================================
  Files         307      307              
  Lines       36878    36884       +6     
==========================================
  Hits        24534    24534              
- Misses      10258    10263       +5     
- Partials     2086     2087       +1     
Flag Coverage Δ
unittests 66.51% <31.81%> (-0.02%) ⬇️

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.

@sophon-zt sophon-zt marked this pull request as ready for review March 5, 2024 06:24
@sophon-zt
Copy link
Contributor Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Mar 5, 2024
@sophon-zt sophon-zt merged commit 562149a into main Mar 5, 2024
200 of 202 checks passed
@sophon-zt sophon-zt deleted the bugfix/oceanbase-static-parameters-reconfigure-didnt-take-effect-issue6741 branch March 5, 2024 10:26
@github-actions github-actions bot added this to the Release 0.8.2 milestone Mar 5, 2024
@sophon-zt
Copy link
Contributor Author

/cherry-pick release-0.8

Copy link

github-actions bot commented Mar 5, 2024

🤖 says: Error cherry-picking.

Auto-merging apis/apps/v1alpha1/configconstraint_types.go
CONFLICT (content): Merge conflict in apis/apps/v1alpha1/configconstraint_types.go
Auto-merging apis/apps/v1alpha1/type.go
Auto-merging apis/apps/v1alpha1/zz_generated.deepcopy.go
Auto-merging config/crd/bases/apps.kubeblocks.io_configconstraints.yaml
CONFLICT (content): Merge conflict in config/crd/bases/apps.kubeblocks.io_configconstraints.yaml
Auto-merging config/crd/bases/apps.kubeblocks.io_opsrequests.yaml
Auto-merging controllers/apps/configuration/reconfigure_policy.go
CONFLICT (content): Merge conflict in controllers/apps/configuration/reconfigure_policy.go
Auto-merging controllers/apps/configuration/sync_upgrade_policy.go
Auto-merging deploy/helm/crds/apps.kubeblocks.io_configconstraints.yaml
CONFLICT (content): Merge conflict in deploy/helm/crds/apps.kubeblocks.io_configconstraints.yaml
Auto-merging deploy/helm/crds/apps.kubeblocks.io_opsrequests.yaml
Auto-merging deploy/helm/templates/addons/apecloud-mysql-addon.yaml
CONFLICT (content): Merge conflict in deploy/helm/templates/addons/apecloud-mysql-addon.yaml
Auto-merging docs/developer_docs/api-reference/cluster.md
Auto-merging pkg/configuration/core/constraint.go
error: could not apply 562149a... feat: support dynamic reload selected parameters policy (#6741) (#6742)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

Copy link

github-actions bot commented Mar 5, 2024

🤖 says: ‼️ cherry pick action failed.
See: https://github.com/apecloud/kubeblocks/actions/runs/8154845581

sophon-zt added a commit that referenced this pull request Mar 5, 2024
Co-authored-by: apecloud-bot <apecloud-bot@users.noreply.github.com>
(cherry picked from commit 562149a)
sophon-zt added a commit that referenced this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR Approved Test feature size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] OceanBase static parameters reconfigure didn't take effect
3 participants