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] Wait for shard relocation before building node to shard allocation map #7876

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

dreamer-89
Copy link
Member

@dreamer-89 dreamer-89 commented Jun 2, 2023

Description

This change fixes the flakyness of recently introduced segment replication bwc test. For doc count assertion, this test first makes API call to index/_stats to build map of shardId to nodeID ([index][1] -> abcdXXX) (separate maps for primary and replica). Once map is built, a targeted search request is made which asserts same doc count for both primary and replica shards. The existing flakyness exists due to shard relocations which completes by the time search query hits the speicfic shard (now moved away to a different node). The fix here is to wait for relocations to complete before verifying doc count.

Related Issues

Resolves #7679

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
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Suraj Singh <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.backpressure.SearchBackpressureIT.testSearchTaskCancellationWithHighCpu
      1 org.opensearch.remotestore.RemoteStoreRefreshListenerIT.testRemoteRefreshRetryOnFailure

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #7876 (431a6ae) into main (b15ffc9) will increase coverage by 0.12%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #7876      +/-   ##
============================================
+ Coverage     70.75%   70.88%   +0.12%     
- Complexity    56244    56246       +2     
============================================
  Files          4689     4689              
  Lines        266340   266340              
  Branches      39098    39098              
============================================
+ Hits         188460   188790     +330     
+ Misses        61933    61520     -413     
- Partials      15947    16030      +83     

see 478 files with indirect coverage changes

Copy link
Contributor

@Poojita-Raj Poojita-Raj left a comment

Choose a reason for hiding this comment

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

LGTM!

@dreamer-89 dreamer-89 merged commit 3387f35 into opensearch-project:main Jun 6, 2023
sandeshkr419 pushed a commit to sandeshkr419/OpenSearch that referenced this pull request Jun 8, 2023
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Jun 23, 2023
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Jun 24, 2023
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Jun 28, 2023
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>

Fix imports

Signed-off-by: Suraj Singh <[email protected]>
dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Jul 11, 2023
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>

Fix imports

Signed-off-by: Suraj Singh <[email protected]>
dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Jul 12, 2023
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>

Fix imports

Signed-off-by: Suraj Singh <[email protected]>
dreamer-89 added a commit that referenced this pull request Jul 13, 2023
…test (#7537) (#7626)

* [Segment Replication] Added mixed and rolling upgrade bwc test (#7537)

* [Segment Replication] Added mixed cluster bwc test

Signed-off-by: Suraj Singh <[email protected]>

* Remove unnecessary gradle task for segrep

Signed-off-by: Suraj Singh <[email protected]>

* Spotless fix

Signed-off-by: Suraj Singh <[email protected]>

* Spotless fix

Signed-off-by: Suraj Singh <[email protected]>

* [Segment Replication] Rolling upgrade test

Signed-off-by: Suraj Singh <[email protected]>

* PR feedback and cleanup

Signed-off-by: Suraj Singh <[email protected]>

* Verify replica doc count only when it is assigned

Signed-off-by: Suraj Singh <[email protected]>

* Remove wait for yellow cluster

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
(cherry picked from commit 0788feb)

Add version check to skip test for 1.x bwc branches

Signed-off-by: Suraj Singh <[email protected]>

* [Segment Replication] Wait for shard relocation before building node to shard allocation map (#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>

Fix imports

Signed-off-by: Suraj Singh <[email protected]>

* [Segment Replication] Update segrep bwc tests to verify replica checkpoints and skip tests for 1.x bwc versions (#8203)

* [Segment Replication] Verify segment replication stats in bwc test

Signed-off-by: Suraj Singh <[email protected]>

* Log cleanup

Signed-off-by: Suraj Singh <[email protected]>

* Spotless check

Signed-off-by: Suraj Singh <[email protected]>

* Add version check to skip test for 1.x bwc branches

Signed-off-by: Suraj Singh <[email protected]>

* Add version check to skip test for 1.x bwc branches for mixed clusters

Signed-off-by: Suraj Singh <[email protected]>

* Add version string in build to identify bwc version

Signed-off-by: Suraj Singh <[email protected]>

* Use correct bwc version string

Signed-off-by: Suraj Singh <[email protected]>

* Address review comments from #7626

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>

[Segment Replication] Use _cat/segments vs index stats + _search to verify doc count

Signed-off-by: Suraj Singh <[email protected]>

Self review

Signed-off-by: Suraj Singh <[email protected]>

remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

Handle 0 doc count segments

Signed-off-by: Suraj Singh <[email protected]>

Add missing import statement

Signed-off-by: Suraj Singh <[email protected]>

* [Segment Replication] Update bwc test to rely on segments for verification (#8267)

* [Segment Replication] Use _cat/segments vs index stats + _search to verify doc count

Signed-off-by: Suraj Singh <[email protected]>

Self review

Signed-off-by: Suraj Singh <[email protected]>

remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

Handle 0 doc count segments

Signed-off-by: Suraj Singh <[email protected]>

* Use 1 minute timeout for assertBusy validations and comments

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>

Add missing import statement

Signed-off-by: Suraj Singh <[email protected]>

* Fix missing import

Signed-off-by: Suraj Singh <[email protected]>

* Logger change

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…to shard allocation map (opensearch-project#7876)

* [Segment Replication] Wait for shard relocation before building node to shard allocation map

Signed-off-by: Suraj Singh <[email protected]>

* Remove unused imports

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
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.

[BUG] org.opensearch.upgrades.IndexingIT.testIndexingWithSegRep test failure
3 participants