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

[Segment Replication] Make SegmentReplicationPressureService a Singleton class and fix bug of rejected_requests reporting incorrect value #7274

Merged
merged 1 commit into from
Apr 22, 2023

Conversation

Rishikesh1159
Copy link
Member

@Rishikesh1159 Rishikesh1159 commented Apr 21, 2023

Description

This PR makes SegmentReplicationPressureService a Singleton class. This way we will only have one instance of SegmentReplicationPressureService per node.

This PR will resolve the bug of rejected_requests column not getting updated in _cat/segment_replication API.

Problem:

-> Initially we were having two instances of SegmentReplicationPressureService. One intstance being used by backpressure mechanism and another instance being used by SegmentReplicationStatsAction class (used by _cat/segment_replication API).

-> As we were having two instances of SegmentReplicationStatsAction class, the changes made by backpressure mechanism are not updated to another instance, so the value of rejected_requests is always being 0 and never getting updated.

Solution:

-> The solution here would be to make SegmentReplicationStatsAction class a singleton class so that there is only one instance of SegmentReplicationStatsAction class per node and value of rejected_requests is always updated correctly.

Issues Resolved

#7275

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: Rishikesh1159 <rishireddy1159@gmail.com>
@Rishikesh1159 Rishikesh1159 changed the title [Segment Replication] Make SegmentReplicationPressureService a Singleton class. [Segment Replication] Make SegmentReplicationPressureService a Singleton class and fix bug of rejected_requests reporting incorrect value Apr 21, 2023
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #7274 (aa2714c) into main (0763d02) will decrease coverage by 0.08%.
The diff coverage is 100.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    #7274      +/-   ##
============================================
- Coverage     70.72%   70.65%   -0.08%     
+ Complexity    59568    59531      -37     
============================================
  Files          4862     4862              
  Lines        285530   285531       +1     
  Branches      41153    41153              
============================================
- Hits         201936   201729     -207     
- Misses        66980    67170     +190     
- Partials      16614    16632      +18     
Impacted Files Coverage Δ
...ain/java/org/opensearch/indices/IndicesModule.java 98.19% <100.00%> (+0.01%) ⬆️

... and 467 files with indirect coverage changes

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

@Rishikesh1159 Rishikesh1159 added backport 2.x Backport to 2.x branch backport 2.7 labels Apr 22, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 22, 2023
(cherry picked from commit 115bb30)
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 Apr 22, 2023
(cherry picked from commit 115bb30)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
nknize pushed a commit that referenced this pull request Apr 22, 2023
(cherry picked from commit 115bb30)
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>
nknize pushed a commit that referenced this pull request Apr 22, 2023
(cherry picked from commit 115bb30)
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>
austintlee pushed a commit to austintlee/OpenSearch that referenced this pull request Apr 28, 2023
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants