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

[Backport 2.x] [Segment Replication] Fix bug where replica shows stale doc count during engine reset. (#9495) #9595

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Aug 28, 2023

Manual backport of (#9495).

…ing engine reset. (opensearch-project#9495)

* Fix bug where replica shows stale doc count during engine reset.

This change fixes an issue where replica shards can temporarily return stale results while converting to a RO engine during an engine reset.  This is possible because NRTReplicationEngine did not previously implement flush and the freshest data is only active on the reader. Fixed by implementing flush and also honoring acquireLatestCommit's flushFirst parameter.

Signed-off-by: Marc Handalian <[email protected]>

* Add changelog entry.

Signed-off-by: Marc Handalian <[email protected]>

* Add unit test for search during engine reset.

Signed-off-by: Marc Handalian <[email protected]>

* Remove useless test.

Signed-off-by: Marc Handalian <[email protected]>

---------

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

Compatibility status:

Checks if related components are compatible with change 1a7df60

Incompatible components

Incompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git]

@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.index.translog.RemoteFSTranslogTests.testMetadataFileDeletion

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #9595 (1a7df60) into 2.x (7a03a66) will increase coverage by 0.01%.
Report is 7 commits behind head on 2.x.
The diff coverage is 69.75%.

@@             Coverage Diff              @@
##                2.x    #9595      +/-   ##
============================================
+ Coverage     70.77%   70.79%   +0.01%     
- Complexity    57617    57679      +62     
============================================
  Files          4768     4769       +1     
  Lines        272372   272568     +196     
  Branches      40117    40128      +11     
============================================
+ Hits         192784   192951     +167     
+ Misses        63113    63107       -6     
- Partials      16475    16510      +35     
Files Changed Coverage Δ
...ons/matrix/stats/MatrixStatsAggregatorFactory.java 69.23% <0.00%> (-5.77%) ⬇️
...s/bucket/geogrid/GeoHashGridAggregatorFactory.java 85.71% <0.00%> (-4.29%) ⬇️
...s/bucket/geogrid/GeoTileGridAggregatorFactory.java 85.71% <0.00%> (-4.29%) ⬇️
...gregations/metrics/GeoBoundsAggregatorFactory.java 81.81% <0.00%> (-8.19%) ⬇️
...h/join/aggregations/ChildrenAggregatorFactory.java 60.00% <0.00%> (-4.29%) ⬇️
...rch/join/aggregations/ParentAggregatorFactory.java 60.00% <0.00%> (-4.29%) ⬇️
...rg/opensearch/common/settings/ClusterSettings.java 93.18% <ø> (ø)
...rc/main/java/org/opensearch/index/IndexModule.java 82.35% <ø> (ø)
...et/adjacency/AdjacencyMatrixAggregatorFactory.java 46.15% <0.00%> (-3.85%) ⬇️
.../bucket/composite/CompositeAggregationFactory.java 85.71% <0.00%> (-14.29%) ⬇️
... and 57 more

... and 430 files with indirect coverage changes

@mch2
Copy link
Member Author

mch2 commented Aug 29, 2023

Gradle Check (Jenkins) Run Completed with:

#9580

@mch2 mch2 merged commit 22e8494 into opensearch-project:2.x Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants