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 - Update /_cat/segment_replication API with backpressure metrics. #6674

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Mar 15, 2023

Description

This change updates the existing /_cat/segment_replication API to include backpressure metrics. It does this by returning stats from primary shards for its tracked replication group and merging it with metrics returned from replicas. Primary captured metrics will now appear by default, with replica per sync events showing when detailed=true is set.

Issues Resolved

Resolves #4478

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.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.persistent.PersistentTasksExecutorFullRestartIT.testFullClusterRestart

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Merging #6674 (246362f) into main (1e5d913) will decrease coverage by 0.04%.
The diff coverage is 30.21%.

📣 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    #6674      +/-   ##
============================================
- Coverage     70.77%   70.73%   -0.04%     
+ Complexity    59250    59231      -19     
============================================
  Files          4808     4809       +1     
  Lines        283454   283501      +47     
  Branches      40868    40873       +5     
============================================
- Hits         200611   200538      -73     
- Misses        66338    66547     +209     
+ Partials      16505    16416      -89     
Impacted Files Coverage Δ
...lication/SegmentReplicationShardStatsResponse.java 0.00% <0.00%> (ø)
...earch/index/SegmentReplicationPressureService.java 80.00% <0.00%> (-1.64%) ⬇️
...org/opensearch/index/seqno/ReplicationTracker.java 67.85% <ø> (-0.35%) ⬇️
...cation/TransportSegmentReplicationStatsAction.java 9.80% <3.03%> (-1.01%) ⬇️
...s/replication/SegmentReplicationStatsResponse.java 13.79% <22.22%> (+0.45%) ⬆️
...opensearch/index/SegmentReplicationShardStats.java 36.58% <33.33%> (+4.23%) ⬆️
...st/action/cat/RestCatSegmentReplicationAction.java 45.09% <47.27%> (-5.93%) ⬇️
...nsearch/index/SegmentReplicationPerGroupStats.java 32.00% <60.00%> (+3.42%) ⬆️
.../org/opensearch/index/SegmentReplicationStats.java 15.38% <100.00%> (ø)
...ensearch/index/SegmentReplicationStatsTracker.java 95.45% <100.00%> (+0.21%) ⬆️

... and 485 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.

…e metrics.

This change updates the existing /_cat/segment_replication API to include backpressure metrics.
It does this by returning stats from primary shards for its tracked replication group and merging it with metrics returned from replicas.
Primary captured  metrics will now appear by default, with replica per sync events showing when detailed=true is set.

Signed-off-by: Marc Handalian <handalm@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@mch2
Copy link
Member Author

mch2 commented Mar 15, 2023

Whitesource scan will be fixed with #6629

mch2 added 2 commits March 16, 2023 09:55
Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Marc Handalian <handalm@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.indices.replication.SegmentReplicationAllocationIT.testSingleIndexShardAllocation
      1 org.opensearch.indices.replication.SegmentReplicationRelocationIT.testFlushAfterRelocation

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.replication.SegmentReplicationRelocationIT.testFlushAfterRelocation
      1 org.opensearch.indices.replication.SegmentReplicationAllocationIT.testSingleIndexShardAllocation

@mch2 mch2 requested a review from dreamer-89 March 16, 2023 18:08
@mch2 mch2 merged commit 188e043 into opensearch-project:main Mar 16, 2023
@mch2 mch2 added the backport 2.x Backport to 2.x branch label Mar 16, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-6674-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 188e043585b652676a5fc6d175f81bdca0ce96df
# Push it to GitHub
git push --set-upstream origin backport/backport-6674-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-6674-to-2.x.

mch2 added a commit to mch2/OpenSearch that referenced this pull request Mar 16, 2023
…ressure metrics. (opensearch-project#6674)

* Segment Replication - Update Segment Replication API with backpressure metrics.

This change updates the existing /_cat/segment_replication API to include backpressure metrics.
It does this by returning stats from primary shards for its tracked replication group and merging it with metrics returned from replicas.
Primary captured  metrics will now appear by default, with replica per sync events showing when detailed=true is set.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* PR Feedback.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fixed current_lag header alias.

Signed-off-by: Marc Handalian <handalm@amazon.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Poojita-Raj pushed a commit to Poojita-Raj/OpenSearch that referenced this pull request Mar 17, 2023
…ressure metrics. (opensearch-project#6674)

* Segment Replication - Update Segment Replication API with backpressure metrics.

This change updates the existing /_cat/segment_replication API to include backpressure metrics.
It does this by returning stats from primary shards for its tracked replication group and merging it with metrics returned from replicas.
Primary captured  metrics will now appear by default, with replica per sync events showing when detailed=true is set.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* PR Feedback.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fixed current_lag header alias.

Signed-off-by: Marc Handalian <handalm@amazon.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Rishikesh1159 pushed a commit that referenced this pull request Mar 18, 2023
…ressure metrics. (#6674) (#6741)

* Segment Replication - Update Segment Replication API with backpressure metrics.

This change updates the existing /_cat/segment_replication API to include backpressure metrics.
It does this by returning stats from primary shards for its tracked replication group and merging it with metrics returned from replicas.
Primary captured  metrics will now appear by default, with replica per sync events showing when detailed=true is set.



* PR Feedback.



* Fixed current_lag header alias.



---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>
mingshl pushed a commit to mingshl/OpenSearch-Mingshl that referenced this pull request Mar 24, 2023
…ressure metrics. (opensearch-project#6674)

* Segment Replication - Update Segment Replication API with backpressure metrics.

This change updates the existing /_cat/segment_replication API to include backpressure metrics.
It does this by returning stats from primary shards for its tracked replication group and merging it with metrics returned from replicas.
Primary captured  metrics will now appear by default, with replica per sync events showing when detailed=true is set.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* PR Feedback.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Fixed current_lag header alias.

Signed-off-by: Marc Handalian <handalm@amazon.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Mingshi Liu <mingshl@amazon.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 skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Segment Replication & Remote Translog] Back-pressure and Recovery for lagging replica copies
4 participants