OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

Introduce TranslogFactory for Local/Remote Translog support

Open Bukhtawar opened this issue 1 year ago • 4 comments

Signed-off-by: Bukhtawar Khan [email protected]

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

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

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.

Bukhtawar avatar Aug 09 '22 08:08 Bukhtawar

Gradle Check (Jenkins) Run Completed with:

  • RESULT: FAILURE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/1613/
  • CommitID: 4c0bfc4537bd3b23af6fa2e6685eb679c3e93357

github-actions[bot] avatar Aug 09 '22 08:08 github-actions[bot]

Gradle Check (Jenkins) Run Completed with:

  • RESULT: FAILURE :x:
  • URL: https://build.ci.opensearch.org/job/gradle-check/1615/
  • CommitID: 1e022c65a81f6281369e5ab1d2e4cf0bdd098788

github-actions[bot] avatar Aug 09 '22 08:08 github-actions[bot]

Gradle Check (Jenkins) Run Completed with:

  • RESULT: SUCCESS :white_check_mark:
  • URL: https://build.ci.opensearch.org/job/gradle-check/1616/
  • CommitID: 8a560769d6b79a00e3afd52d8411c31c01ac0484

github-actions[bot] avatar Aug 09 '22 09:08 github-actions[bot]

Codecov Report

Merging #4172 (8a56076) into main (a469a3c) will increase coverage by 0.03%. The diff coverage is 85.71%.

@@             Coverage Diff              @@
##               main    #4172      +/-   ##
============================================
+ Coverage     70.59%   70.63%   +0.03%     
+ Complexity    57083    57081       -2     
============================================
  Files          4603     4604       +1     
  Lines        274551   274561      +10     
  Branches      40210    40211       +1     
============================================
+ Hits         193831   193933     +102     
+ Misses        64514    64394     -120     
- Partials      16206    16234      +28     
Impacted Files Coverage Δ
...c/main/java/org/opensearch/index/IndexService.java 73.63% <0.00%> (-0.17%) :arrow_down:
...g/opensearch/index/engine/EngineConfigFactory.java 88.63% <ø> (ø)
...earch/index/translog/WriteOnlyTranslogManager.java 60.00% <ø> (ø)
...org/opensearch/index/shard/IndexShardTestCase.java 91.45% <ø> (-2.60%) :arrow_down:
...n/java/org/opensearch/index/engine/NoOpEngine.java 65.27% <80.00%> (+0.48%) :arrow_up:
...va/org/opensearch/index/engine/ReadOnlyEngine.java 74.07% <80.00%> (+1.68%) :arrow_up:
...java/org/opensearch/index/engine/EngineConfig.java 97.40% <100.00%> (+0.06%) :arrow_up:
...va/org/opensearch/index/engine/InternalEngine.java 75.39% <100.00%> (-0.70%) :arrow_down:
.../opensearch/index/engine/NRTReplicationEngine.java 76.19% <100.00%> (+0.99%) :arrow_up:
...in/java/org/opensearch/index/shard/IndexShard.java 69.10% <100.00%> (-0.24%) :arrow_down:
... and 477 more

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

codecov-commenter avatar Aug 09 '22 09:08 codecov-commenter

Please add description, issue link and update the checklist.

sachinpkale avatar Aug 12 '22 09:08 sachinpkale

This looks good. There is one thing which will probably play a crucial role in defining the lower level semantics - We have TranslogManager, & TranslogFactory. Basis my understanding, TranslogFactory would provide us different abstraction for storage (local/remote) and TranslogManager helps us define integration of the Engine with the underlying Translog provided by TranslogFactory. This makes it look that TranslogFactory and TranslogManager implementation might be hardwired, is it fairly right understanding? I think this is a good extensibility point - but may be in future we might want to converge to single TranslogManagerCumFactory that helps us with both the needs?

ashking94 avatar Aug 16 '22 09:08 ashking94

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-4172-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 551f7c3481040a3b4b051a27eec973c90fb5def6
# Push it to GitHub
git push --set-upstream origin backport/backport-4172-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-4172-to-2.x.