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] Add lucene codec tests #7903

Merged
merged 4 commits into from
Jun 7, 2023

Conversation

dreamer-89
Copy link
Member

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

Description

This change adds integration tests for lucene codecs.

  1. testWithOlderCodecs. Validate that segment replication works with older lucene codecs. Verified with string matching checks, this test fails. Tested this on branch codec-string-match
  2. testWithDifferentCompressionModes. Validates that segment replication works with different codec compression modes.

Related Issues

Resolves #7781
#3881

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:

@dreamer-89
Copy link
Member Author

dreamer-89 commented Jun 5, 2023

The PR still blocked on usage of openStream() method call and fails due :server:forbiddenApisInternalClusterTest task. It fails in below line

ZipInputStream zip = new ZipInputStream(Codec.class.getProtectionDomain().getCodeSource().getLocation().openStream());

Gradle failure

> Task :server:forbiddenApisInternalClusterTest FAILED
Forbidden method invocation: java.net.URL#openStream() [Don't open socket connections]
  in org.opensearch.indices.replication.SegmentReplicationIT (SegmentReplicationIT.java:1355)
Scanned 734 class file(s) for forbidden API invocations (in 1.05s), 1 error(s).

Alternative

I tried walkFileTree alternative but it makes to fail with access denied error.

access denied ("java.io.FilePermission" "file:/Users/singhnjb/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-core/9.7.0-snapshot-4d1ed9e/8e87d93868271da754a7c22517b3dbbcf84fc7f9/lucene-core-9.7.0-snapshot-4d1ed9e.jar!\org.apache.lucene" "read")
java.security.AccessControlException: access denied ("java.io.FilePermission" "file:/Users/singhnjb/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-core/9.7.0-snapshot-4d1ed9e/8e87d93868271da754a7c22517b3dbbcf84fc7f9/lucene-core-9.7.0-snapshot-4d1ed9e.jar!\org.apache.lucene" "read")
	at __randomizedtesting.SeedInfo.seed([ED0C32C5C80EC389:6F82318B95ED42F9]:0)
	at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:488)
        Path uriPath = PathUtils.get(Codec.class.getProtectionDomain().getCodeSource().getLocation().toURI() + "!\\org.apache.lucene");
        Files.walkFileTree(uriPath, new SimpleFileVisitor<Path>() {
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
                logger.info("--> File {}", file.getFileName());
                return FileVisitResult.CONTINUE;
            }
        });

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Gradle Check (Jenkins) Run Completed with:

@dreamer-89
Copy link
Member Author

Gradle Check (Jenkins) Run Completed with:

#7873

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.backpressure.SearchBackpressureIT.testSearchShardTaskCancellationWithHighCpu

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #7903 (6f33bd9) into main (2a3683e) will increase coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #7903      +/-   ##
============================================
+ Coverage     70.83%   70.84%   +0.01%     
+ Complexity    56340    56318      -22     
============================================
  Files          4701     4701              
  Lines        266595   266595              
  Branches      39101    39101              
============================================
+ Hits         188834   188861      +27     
+ Misses        61803    61710      -93     
- Partials      15958    16024      +66     

see 476 files with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Gradle Check (Jenkins) Run Completed with:

@dreamer-89
Copy link
Member Author

Gradle Check (Jenkins) Run Completed with:

Looks unrelated.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':distribution:archives:buildLinuxPpc64leTar'.
> Could not resolve all files for configuration ':distribution:archives:jdk_bundled_linux_ppc64le'.
   > Failed to transform linux-20.0.1-ppc64le.tar.gz (adoptium_20:linux:20.0.1) to match attributes {artifactType=directory, jdk=true, org.gradle.status=integration}.
      > Could not find linux-20.0.1-ppc64le.tar.gz (adoptium_20:linux:20.0.1).
        Searched in the following locations:

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

github-actions bot commented Jun 7, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.backpressure.SearchBackpressureIT.testSearchTaskCancellationWithHighCpu
      1 org.opensearch.monitor.fs.FsHealthServiceTests.testFailsHealthOnHungIOBeyondHealthyTimeout

@dreamer-89 dreamer-89 merged commit f25f61b into opensearch-project:main Jun 7, 2023
@dreamer-89 dreamer-89 added the backport 2.x Backport to 2.x branch label Jun 7, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 7, 2023
* Resolve forbidden APIs

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

* Address review comments

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

* Remove older lucene test

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

* Remove older lucene test

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

---------

Signed-off-by: Suraj Singh <[email protected]>
(cherry picked from commit f25f61b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dblock pushed a commit that referenced this pull request Jun 7, 2023
* Resolve forbidden APIs



* Address review comments



* Remove older lucene test



* Remove older lucene test



---------


(cherry picked from commit f25f61b)

Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dblock pushed a commit to dblock/OpenSearch that referenced this pull request Jun 8, 2023
* Resolve forbidden APIs

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

* Address review comments

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

* Remove older lucene test

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

* Remove older lucene test

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

---------

Signed-off-by: Suraj Singh <[email protected]>
sandeshkr419 pushed a commit to sandeshkr419/OpenSearch that referenced this pull request Jun 8, 2023
* Resolve forbidden APIs

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

* Address review comments

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

* Remove older lucene test

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

* Remove older lucene test

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

---------

Signed-off-by: Suraj Singh <[email protected]>
gaiksaya pushed a commit to gaiksaya/OpenSearch that referenced this pull request Jun 26, 2023
opensearch-project#7958)

* Resolve forbidden APIs



* Address review comments



* Remove older lucene test



* Remove older lucene test



---------


(cherry picked from commit f25f61b)

Signed-off-by: Suraj Singh <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Resolve forbidden APIs

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

* Address review comments

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

* Remove older lucene test

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

* Remove older lucene test

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
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [Segment Replication] Segment replication is broken for plugins using custom codecs
3 participants