opensearch-project / cross-cluster-replication

Synchronize your data across multiple clusters for lower latencies and higher availability
https://opensearch.org/docs/latest/replication-plugin/index/
Apache License 2.0
50 stars 59 forks source link

Updates integTest behavior to accept the version and set the password accordingly, and force HTTP1 policy for local clusters #1318

Closed DarshitChanpura closed 9 months ago

DarshitChanpura commented 9 months ago

Description

integtest.sh run by opensearch-build passes -v to supply opensearch version however it was not being consumed on CCR side. This PR consumes that version to conditionally set the password correctly and fixes:

2024-02-05 13:17:41 INFO     /tmp/tmpp1sdta5m/cross-cluster-replication/scripts/integtest.sh: line 78: ((: > 2 || ( == 2 &&  >= 12) : syntax error: operand expected (error token is "> 2 || ( == 2 &&  >= 12) ")

https://build.ci.opensearch.org/blue/rest/organizations/jenkins/pipelines/integ-test/runs/7592/nodes/98/steps/579/log/?start=0

Issues Resolved

Check List

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.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (043a788) 74.19% compared to head (84b3422) 76.55%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1318 +/- ## ============================================ + Coverage 74.19% 76.55% +2.36% - Complexity 1023 1050 +27 ============================================ Files 141 141 Lines 4782 4782 Branches 526 526 ============================================ + Hits 3548 3661 +113 + Misses 883 771 -112 + Partials 351 350 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DarshitChanpura commented 9 months ago

Security tests no-longer fail with unauthorized. instead they fail with:

Caused by:
        org.apache.hc.core5.http.ParseException: Invalid protocol version; error at offset 0: <[0x2e][0x2f][0x30][0x31][0x32][0x33][0x34][0x35][0x36][0x37][0x38][0x39][0x3a] [0x3c][0x3d][0x3e]e[0x40][0x41][0x42][0x43][0x44][0x45]???[0x4a][0x4b][0x4c][0x4d]Unexpected HTTP/1.x request: GET /_cluster/settings?include_defaults=true&flat_settings=true >
DarshitChanpura commented 9 months ago

@monusingh-1 Mind reviewing this one?

DarshitChanpura commented 9 months ago

@monusingh-1 Mind giving this another look? I've fixed the broken security tests.

DarshitChanpura commented 9 months ago

@monusingh-1 @ankitkala I've addressed the feedback. Mind re-reviewing it?

opensearch-trigger-bot[bot] commented 9 months ago

The backport to 2.x failed:

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

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
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1318-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d703887f88f24c444e0513ebeca21e30b93354f8
# Push it to GitHub
git push --set-upstream origin backport/backport-1318-to-2.x
# Go back to the original working tree
cd ../..
# 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-1318-to-2.x.

opensearch-trigger-bot[bot] commented 9 months ago

The backport to 2.12 failed:

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

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.12 2.12
# Navigate to the new working tree
cd .worktrees/backport-2.12
# Create a new branch
git switch --create backport/backport-1318-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d703887f88f24c444e0513ebeca21e30b93354f8
# Push it to GitHub
git push --set-upstream origin backport/backport-1318-to-2.12
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.12

Then, create a pull request where the base branch is 2.12 and the compare/head branch is backport/backport-1318-to-2.12.