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

change disk circuit breaker to cluster settings #2634

Conversation

zane-neo
Copy link
Collaborator

@zane-neo zane-neo commented Jul 10, 2024

Description

change disk circuit breaker to cluster settings

Issues Resolved

#2639

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: zane-neo <[email protected]>
Signed-off-by: zane-neo <[email protected]>
Signed-off-by: zane-neo <[email protected]>
Signed-off-by: zane-neo <[email protected]>
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 02:32 — with GitHub Actions Inactive
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 02:32 — with GitHub Actions Inactive
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 03:32 — with GitHub Actions Inactive
* * Copyright OpenSearch Contributors
* * SPDX-License-Identifier: Apache-2.0
*
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

the license header seems not with right format

/*
 * Copyright OpenSearch Contributors
 * SPDX-License-Identifier: Apache-2.0
 */

Integer.MAX_VALUE,
Setting.Property.NodeScope,
Setting.Property.Dynamic
);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: another alternative could be ByteSizeValue instead of int. it has more fine-grained control.

/**
* An abstract class for all breakers with threshold.
* @param <T> data type of threshold
*/
@Data
public abstract class ThresholdCircuitBreaker<T> implements CircuitBreaker {

private T threshold;
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add volatile modifier for this field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's better to add volatile so that each thread can read the up-to-date value of this.

Signed-off-by: zane-neo <[email protected]>
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 05:40 — with GitHub Actions Inactive
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 06:42 — with GitHub Actions Inactive
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 06:42 — with GitHub Actions Inactive
@zane-neo zane-neo temporarily deployed to ml-commons-cicd-env July 11, 2024 07:40 — with GitHub Actions Inactive
@zane-neo zane-neo merged commit b6618b2 into opensearch-project:main Jul 12, 2024
7 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 12, 2024
* change disk circuit breaker to cluster settings

Signed-off-by: zane-neo <[email protected]>

* Fix IT failure

Signed-off-by: zane-neo <[email protected]>

* format code

Signed-off-by: zane-neo <[email protected]>

* fix failure UT

Signed-off-by: zane-neo <[email protected]>

* fix failure IT

Signed-off-by: zane-neo <[email protected]>

* Address comments

Signed-off-by: zane-neo <[email protected]>

---------

Signed-off-by: zane-neo <[email protected]>
(cherry picked from commit b6618b2)
zane-neo added a commit that referenced this pull request Jul 12, 2024
* change disk circuit breaker to cluster settings

Signed-off-by: zane-neo <[email protected]>

* Fix IT failure

Signed-off-by: zane-neo <[email protected]>

* format code

Signed-off-by: zane-neo <[email protected]>

* fix failure UT

Signed-off-by: zane-neo <[email protected]>

* fix failure IT

Signed-off-by: zane-neo <[email protected]>

* Address comments

Signed-off-by: zane-neo <[email protected]>

---------

Signed-off-by: zane-neo <[email protected]>
(cherry picked from commit b6618b2)

Co-authored-by: zane-neo <[email protected]>
@b4sjoo b4sjoo added the v2.16.0 Issues targeting release v2.16.0 label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x v2.16.0 Issues targeting release v2.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants