Skip to content

[Segment Replication] Add PIT/Scroll compatibility with Segment Replication#6644

Closed
mch2 wants to merge 3 commits intoopensearch-project:mainfrom
mch2:segrep-pit
Closed

[Segment Replication] Add PIT/Scroll compatibility with Segment Replication#6644
mch2 wants to merge 3 commits intoopensearch-project:mainfrom
mch2:segrep-pit

Conversation

@mch2
Copy link
Copy Markdown
Member

@mch2 mch2 commented Mar 13, 2023

Description

This change makes updates to make PIT/Scroll queries compatible with Segment Replication. It does this by refcounting files when a new reader is created, and discarding those files after a reader is closed.

Issues Resolved

#6519

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

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 13, 2023

Codecov Report

❌ Patch coverage is 84.44444% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@ad823b6). Learn more about missing BASE report.
⚠️ Report is 4095 commits behind head on main.

Files with missing lines Patch % Lines
...rc/main/java/org/opensearch/index/store/Store.java 72.72% 0 Missing and 3 partials ⚠️
.../opensearch/index/engine/NRTReplicationEngine.java 80.00% 2 Missing ⚠️
...org/opensearch/index/store/ReplicaFileTracker.java 87.50% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6644   +/-   ##
=======================================
  Coverage        ?   70.75%           
  Complexity      ?    59246           
=======================================
  Files           ?     4810           
  Lines           ?   283497           
  Branches        ?    40873           
=======================================
  Hits            ?   200585           
  Misses          ?    66462           
  Partials        ?    16450           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.replication.SegmentReplicationIT.testPitCreatedOnReplica

mch2 added 2 commits March 15, 2023 14:30
This change makes updates to make PIT/Scroll queries compatibile with Segment Replication.
It does this by refcounting files when a new reader is created, and discarding those files after
a reader is closed.

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

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

…of current store state.

Signed-off-by: Marc Handalian <handalm@amazon.com>
@mch2 mch2 marked this pull request as ready for review March 17, 2023 00:17
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@dreamer-89
Copy link
Copy Markdown
Member

Closing this PR in favour of #6765 (author is on leave)

CC @anasalkouz

@dreamer-89 dreamer-89 closed this Mar 20, 2023
dreamer-89 added a commit that referenced this pull request Apr 5, 2023
…cation #6644 (#6765)

* Segment Replication - PIT/Scroll compatibility.

This change makes updates to make PIT/Scroll queries compatibile with Segment Replication.
It does this by refcounting files when a new reader is created, and discarding those files after
a reader is closed.

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

* Fix broken test.

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

* Fix test bug with PIT where snapshotted segments are queried instead of current store state.

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

* Address review comments and prevent temp file deletion during reader close

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix precommit failure

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Use last committed segment infos reference from replication engine

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Clean up and prevent incref on segment info file copied from primary

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing test

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>
dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Apr 5, 2023
…cation opensearch-project#6644 (opensearch-project#6765)

* Segment Replication - PIT/Scroll compatibility.

This change makes updates to make PIT/Scroll queries compatibile with Segment Replication.
It does this by refcounting files when a new reader is created, and discarding those files after
a reader is closed.

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

* Fix broken test.

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

* Fix test bug with PIT where snapshotted segments are queried instead of current store state.

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

* Address review comments and prevent temp file deletion during reader close

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix precommit failure

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Use last committed segment infos reference from replication engine

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Clean up and prevent incref on segment info file copied from primary

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing test

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>
dreamer-89 added a commit that referenced this pull request Apr 5, 2023
…cation (#7010)

* [Segment Replication] Add PIT/Scroll compatibility with Segment Replication #6644 (#6765)

* Segment Replication - PIT/Scroll compatibility.

This change makes updates to make PIT/Scroll queries compatibile with Segment Replication.
It does this by refcounting files when a new reader is created, and discarding those files after
a reader is closed.

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

* Fix broken test.

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

* Fix test bug with PIT where snapshotted segments are queried instead of current store state.

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

* Address review comments and prevent temp file deletion during reader close

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix precommit failure

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Use last committed segment infos reference from replication engine

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Clean up and prevent incref on segment info file copied from primary

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Fix failing test

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>

* Add param definition causing precommit failure

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Remove unnecessary override annotation

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Marc Handalian <handalm@amazon.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>
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.

3 participants