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

Fix a bug in Search Backpressure #6455

Merged
merged 4 commits into from
Feb 23, 2023

Conversation

PritLadani
Copy link
Contributor

@PritLadani PritLadani commented Feb 23, 2023

Description

Bug-fix in Search Backpressure's HeapUsageTracker.

Issues Resolved

#5173

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
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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: PritLadani pritkladani@gmail.com

Signed-off-by: PritLadani <pritkladani@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #6455 (7e76ecd) into main (4dd0c5f) will increase coverage by 0.07%.
The diff coverage is 90.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6455      +/-   ##
============================================
+ Coverage     70.76%   70.83%   +0.07%     
+ Complexity    59093    59068      -25     
============================================
  Files          4802     4800       -2     
  Lines        282793   282712      -81     
  Branches      40782    40763      -19     
============================================
+ Hits         200111   200261     +150     
+ Misses        66271    66003     -268     
- Partials      16411    16448      +37     
Impacted Files Coverage Δ
...va/org/opensearch/cluster/routing/RoutingNode.java 78.53% <ø> (-0.26%) ⬇️
...ting/allocation/allocator/LocalShardsBalancer.java 84.90% <ø> (-0.33%) ⬇️
...r/routing/allocation/allocator/ShardsBalancer.java 33.33% <ø> (+8.33%) ⬆️
...search/common/settings/AbstractScopedSettings.java 88.38% <ø> (+1.25%) ⬆️
...rg/opensearch/common/settings/ClusterSettings.java 91.89% <ø> (ø)
...n/java/org/opensearch/common/settings/Setting.java 86.13% <ø> (-0.22%) ⬇️
.../allocation/allocator/BalancedShardsAllocator.java 91.17% <85.71%> (+0.60%) ⬆️
...egations/support/MultiTermsValuesSourceConfig.java 80.32% <100.00%> (ø)
...egations/support/MultiValuesSourceFieldConfig.java 92.50% <100.00%> (ø)
...search/backpressure/trackers/HeapUsageTracker.java 68.96% <100.00%> (+3.44%) ⬆️
... and 493 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: PritLadani <pritkladani@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@PritLadani
Copy link
Contributor Author

@reta can you please help to merge this small bug fix CR?

CHANGELOG.md Outdated
@@ -70,6 +70,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased 2.x]
### Added
- Add GeoTile and GeoHash Grid aggregations on GeoShapes. ([#5589](https://github.com/opensearch-project/OpenSearch/pull/5589))
- Small bug fix in Search Backpressure's HeapUsageTracker ([#6455](https://github.com/opensearch-project/OpenSearch/pull/6455))
Copy link
Collaborator

Choose a reason for hiding this comment

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

For small non-customer facing changes , we can skip the changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, removing it.

@reta
Copy link
Collaborator

reta commented Feb 23, 2023

@reta can you please help to merge this small bug fix CR?

@PritLadani my apologies, I am on vacation the rest of the week

@PritLadani PritLadani requested a review from gbbafna February 23, 2023 12:27
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.cluster.service.MasterServiceTests.classMethod
      1 org.opensearch.cluster.service.MasterServiceTests.testThrottlingForMultipleTaskTypes

Signed-off-by: PritLadani <pritkladani@gmail.com>
@@ -107,7 +107,7 @@ public static boolean isHeapTrackingSupported() {
*/
public static boolean isHeapUsageDominatedBySearch(List<CancellableTask> cancellableTasks, double heapPercentThreshold) {
long usage = cancellableTasks.stream().mapToLong(task -> task.getTotalResourceStats().getMemoryInBytes()).sum();
long threshold = (long) heapPercentThreshold * HEAP_SIZE_BYTES;
long threshold = (long) (heapPercentThreshold * HEAP_SIZE_BYTES);
Copy link
Member

@dreamer-89 dreamer-89 Feb 23, 2023

Choose a reason for hiding this comment

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

nit: Good to have one unit test which verifies this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PritLadani Can you add unit tests here in a follow up PR? This is a public static method and should be pretty straightforward to unit test.

Done here. #6463
Thanks!

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.replication.SegmentReplicationRelocationIT.testNewlyAddedReplicaIsUpdated

@dreamer-89
Copy link
Member

testNewlyAddedReplicaIsUpdated

Tracking in #6459

REPRODUCE WITH: ./gradlew ':server:internalClusterTest' --tests "org.opensearch.indices.replication.SegmentReplicationRelocationIT.testNewlyAddedReplicaIsUpdated" -Dtests.seed=A3D21C76F7A36009 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=es-CU -Dtests.timezone=Africa/Algiers -Druntime.java=19

org.opensearch.indices.replication.SegmentReplicationRelocationIT > testNewlyAddedReplicaIsUpdated FAILED
    java.lang.AssertionError
        at __randomizedtesting.SeedInfo.seed([A3D21C76F7A36009:E5CCE64E0859A9D0]:0)
        at org.junit.Assert.fail(Assert.java:87)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at org.junit.Assert.assertFalse(Assert.java:65)
        at org.junit.Assert.assertFalse(Assert.java:75)
        at org.opensearch.indices.replication.SegmentReplicationRelocationIT.testNewlyAddedReplicaIsUpdated(SegmentReplicationRelocationIT.java:432)

@andrross
Copy link
Member

Can you provide a more descriptive commit message/PR title? Something like "Fix integer math bug in HeapUsageTracker"

@dreamer-89
Copy link
Member

@PritLadani : The DCO check is failing right now. Can you please fix this

@kartg
Copy link
Member

kartg commented Feb 23, 2023

@PritLadani : The DCO check is failing right now. Can you please fix this

@dreamer-89 looks like the offending commit is the revert. Since we're trying to merge this as a critical bugfix for the 2.6 release, I'll go ahead and set the DCO check to pass and merge this in. Let me know if you've got any concerns.

@andrross
Copy link
Member

@PritLadani Can you add unit tests here in a follow up PR? This is a public static method and should be pretty straightforward to unit test.

@kartg kartg merged commit d439244 into opensearch-project:main Feb 23, 2023
@kartg kartg added backport 2.x Backport to 2.x branch backport 2.6 Backport to 2.6 branch labels Feb 23, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 23, 2023
* Fix a bug in Search Backpressure

Signed-off-by: PritLadani <pritkladani@gmail.com>

---------

Signed-off-by: PritLadani <pritkladani@gmail.com>
(cherry picked from commit d439244)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 23, 2023
* Fix a bug in Search Backpressure

Signed-off-by: PritLadani <pritkladani@gmail.com>

---------

Signed-off-by: PritLadani <pritkladani@gmail.com>
(cherry picked from commit d439244)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
andrross pushed a commit that referenced this pull request Feb 23, 2023
* Fix a bug in Search Backpressure



---------


(cherry picked from commit d439244)

Signed-off-by: PritLadani <pritkladani@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
andrross pushed a commit that referenced this pull request Feb 23, 2023
* Fix a bug in Search Backpressure



---------


(cherry picked from commit d439244)

Signed-off-by: PritLadani <pritkladani@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport 2.6 Backport to 2.6 branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants