-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PinotBufferFactory and a buffer implementation that uses Unsafe #10528
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
Changes from all commits
b25a911
619c2ae
a2a10a2
4ba9038
4dd8c04
f01e7a0
ac15382
f3ed739
dc22718
d902046
2ee7460
db087e7
80a28c6
19e1508
910ffbd
a7d4dd1
9352af9
90a5d0f
f535368
d211770
d264fcd
7d477ff
28f1660
50eb9ae
44ae726
338b96c
1d97eba
aa3560e
22121e7
aa9bdc7
abe9ac5
3217bb6
e76fb47
f4f6224
967114e
6d0b502
ba0f427
576cf0f
4169ea3
81f8371
f4a55d1
53f2a95
8c0d334
b05691b
4b3476d
aa303bb
b739b00
b02702d
76d5ea6
b8e631d
16fb3b0
8e97581
e575174
9ab14ca
bd4720f
90485ee
cdb615c
de96879
27a6905
ebcfc26
c073a1f
41002cc
94d4f89
44048e5
b2e96b3
8f4b76b
f718193
d0e936b
3cb4e1c
6bb99a1
e95b0b7
55d1f87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,16 +72,20 @@ jobs: | |
| if: github.repository == 'apache/pinot' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| # Changed to false in order to improve coverage using unsafe buffers | ||
| fail-fast: false | ||
| matrix: | ||
| testset: [ 1, 2 ] | ||
| name: Pinot Unit Test Set ${{ matrix.testset }} | ||
| java: [ 11, 17, 20 ] | ||
| distribution: [ "temurin" ] | ||
| name: Pinot Unit Test Set ${{ matrix.testset }} (${{matrix.distribution}}-${{matrix.java}}) | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up JDK 11 | ||
| - name: Set up JDK ${{ matrix.java }} | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: 11 | ||
| distribution: 'adopt' | ||
| java-version: ${{ matrix.java }} | ||
| distribution: ${{ matrix.distribution }} | ||
| cache: 'maven' | ||
| # Step that does that actual cache save and restore | ||
| - uses: actions/cache@v3 | ||
|
|
@@ -111,7 +115,7 @@ jobs: | |
| continue-on-error: true | ||
| timeout-minutes: 5 | ||
| with: | ||
| flags: unittests${{ matrix.testset }} | ||
| flags: unittests${{ matrix.testset }}${{matrix.distribution}}${{matrix.java}} | ||
| name: codecov-unit-tests | ||
| fail_ci_if_error: false | ||
| verbose: true | ||
|
|
@@ -120,16 +124,20 @@ jobs: | |
| if: github.repository == 'apache/pinot' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| # Changed to false in order to improve coverage using unsafe buffers | ||
| fail-fast: false | ||
| matrix: | ||
| testset: [ 1, 2 ] | ||
| name: Pinot Integration Test Set ${{ matrix.testset }} | ||
| java: [ 11, 17, 20 ] | ||
| distribution: [ "temurin" ] | ||
| name: Pinot Integration Test Set ${{ matrix.testset }} (${{matrix.distribution}}-${{matrix.java}}) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will the github actions end to end now take 6 times as longer than before? Or would they run in parallel? If the latter, do we know that we have enough resources on there to handle the increased num tasks?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
They will run in parallel. Tests on this branch finish in about 1 hour, as usual.
I don't know the resources we have. We are going to consume more resources for sure. |
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up JDK 11 | ||
| - name: Set up JDK ${{ matrix.java }} | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: 11 | ||
| distribution: 'adopt' | ||
| java-version: ${{ matrix.java }} | ||
| distribution: ${{ matrix.distribution }} | ||
| cache: 'maven' | ||
| # Step that does that actual cache save and restore | ||
| - uses: actions/cache@v3 | ||
|
|
@@ -159,7 +167,7 @@ jobs: | |
| continue-on-error: true | ||
| timeout-minutes: 5 | ||
| with: | ||
| flags: integration${{ matrix.testset }} | ||
| flags: integration${{ matrix.testset }}${{matrix.distribution}}${{matrix.java}} | ||
| name: codecov-integration-tests | ||
| fail_ci_if_error: false | ||
| verbose: true | ||
|
|
@@ -168,6 +176,8 @@ jobs: | |
| if: github.repository == 'apache/pinot' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| # Changed to false in order to improve coverage using unsafe buffers | ||
| fail-fast: false | ||
| matrix: | ||
| test_suite: [ "compatibility-verifier/sample-test-suite" ] | ||
| old_commit: [ | ||
|
|
@@ -221,18 +231,19 @@ jobs: | |
| if: github.repository == 'apache/pinot' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| # Changed to false in order to improve coverage using unsafe buffers | ||
| fail-fast: false | ||
| matrix: | ||
| # We only test LTS Java versions | ||
| # TODO: add JDK 17 once ready. see: https://github.com/apache/pinot/issues/8529 | ||
| java: [ 8, 11, 15 ] | ||
| java: [ 11, 17, 20 ] | ||
|
gortiz marked this conversation as resolved.
Outdated
|
||
| distribution: [ "temurin" ] | ||
| name: Pinot Quickstart on JDK ${{ matrix.java }} | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up JDK ${{ matrix.java }} | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: ${{ matrix.java }} | ||
| distribution: 'adopt' | ||
| distribution: ${{ matrix.distribution }} | ||
| cache: 'maven' | ||
| # Step that does that actual cache save and restore | ||
| - uses: actions/cache@v3 | ||
|
|
@@ -252,25 +263,6 @@ jobs: | |
| name: Build Presto Pinot Driver | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: 11 | ||
| distribution: 'adopt' | ||
| cache: 'maven' | ||
| - name: Build presto pinot driver with JDK 11 | ||
| env: | ||
| MAVEN_OPTS: > | ||
| -Xmx2G -DfailIfNoTests=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 | ||
| -Dmaven.wagon.http.retryHandler.count=30 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false | ||
| -XX:+IgnoreUnrecognizedVMOptions | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED | ||
| --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | ||
| run: | | ||
| mvn clean install -DskipTests -Ppresto-driver -am -B -pl ':presto-pinot-driver' -T 16 || exit 1 | ||
| - name: Set up JDK 8 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
|
|
@@ -281,4 +273,4 @@ jobs: | |
| env: | ||
| MAVEN_OPTS: -Xmx2G -DfailIfNoTests=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=30 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false | ||
| run: | | ||
| mvn clean install -DskipTests -Ppresto-driver -am -B -pl ':presto-pinot-driver' -Djdk.version=8 -T 16 || exit 1 | ||
| mvn clean install -Dmaven.test.skip=true -Ppresto-driver -am -B -pl ':presto-pinot-driver' -Djdk.version=8 -T 16 || exit 1 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change required? Or both ways work?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,18 +27,21 @@ netstat -i | |
|
|
||
| if [ "$RUN_INTEGRATION_TESTS" != false ]; then | ||
| # Integration Tests | ||
| mvn clean install -DskipTests -am -B -pl 'pinot-integration-tests' -T 16 || exit 1 | ||
| mvn clean install -DskipTests -Dcheckstyle.skip -Dspotless.apply.skip -Dlicense.skip=true -am -B \ | ||
| -pl 'pinot-integration-tests' -T 16 || exit 1 | ||
| if [ "$RUN_TEST_SET" == "1" ]; then | ||
| mvn test -am -B \ | ||
| -pl 'pinot-integration-tests' \ | ||
| -Dtest='C*Test,L*Test,M*Test,R*Test,S*Test' \ | ||
| -P github-actions,integration-tests-only && exit 0 || exit 1 | ||
| -P github-actions,integration-tests-only \ | ||
| -Dcheckstyle.skip -Dspotless.apply.skip -Dlicense.skip=true && exit 0 || exit 1 | ||
| fi | ||
| if [ "$RUN_TEST_SET" == "2" ]; then | ||
| mvn test -am -B \ | ||
| -pl 'pinot-integration-tests' \ | ||
| -Dtest='!C*Test,!L*Test,!M*Test,!R*Test,!S*Test' \ | ||
| -P github-actions,integration-tests-only && exit 0 || exit 1 | ||
| -P github-actions,integration-tests-only \ | ||
| -Dcheckstyle.skip -Dspotless.apply.skip -Dlicense.skip=true && exit 0 || exit 1 | ||
| fi | ||
| else | ||
| # Unit Tests | ||
|
|
@@ -60,10 +63,11 @@ else | |
| -pl ':pinot-csv' \ | ||
| -pl ':pinot-json' \ | ||
| -pl ':pinot-segment-uploader-default' \ | ||
| -P github-actions,no-integration-tests && exit 0 || exit 1 | ||
| -P github-actions,no-integration-tests \ | ||
| -Dcheckstyle.skip -Dspotless.apply.skip -Dlicense.skip=true && exit 0 || exit 1 | ||
| fi | ||
| if [ "$RUN_TEST_SET" == "2" ]; then | ||
| mvn clean install -DskipTests -T 16 || exit 1 | ||
| mvn clean install -DskipTests -Dcheckstyle.skip -Dspotless.apply.skip -Dlicense.skip=true -T 16 || exit 1 | ||
| mvn test -am -B \ | ||
| -pl '!pinot-spi' \ | ||
| -pl '!pinot-segment-spi' \ | ||
|
|
@@ -79,7 +83,9 @@ else | |
| -pl '!:pinot-csv' \ | ||
| -pl '!:pinot-json' \ | ||
| -pl '!:pinot-segment-uploader-default' \ | ||
| -P github-actions,no-integration-tests && exit 0 || exit 1 | ||
| -P github-actions,no-integration-tests \ | ||
| -Dspotless.apply.skip -Dcheckstyle.skip -Dspotless.apply.skip -Dlicense.skip=true \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why add skips for all these?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are 3 reasons:
|
||
| && exit 0 || exit 1 | ||
| fi | ||
| fi | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,8 @@ | |
| import org.apache.pinot.spi.utils.CommonConstants.Broker.FailureDetector; | ||
| import org.apache.pinot.spi.utils.CommonConstants.Helix.StateModel.BrokerResourceStateModel; | ||
| import org.apache.pinot.util.TestUtils; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import org.testng.annotations.Test; | ||
|
|
||
| import static org.testng.Assert.assertEquals; | ||
|
|
@@ -45,6 +47,7 @@ | |
| * Integration test that extends OfflineClusterIntegrationTest but start multiple brokers and servers. | ||
| */ | ||
| public class MultiNodesOfflineClusterIntegrationTest extends OfflineClusterIntegrationTest { | ||
| private static final Logger LOGGER = LoggerFactory.getLogger(MultiNodesOfflineClusterIntegrationTest.class); | ||
| private static final int NUM_BROKERS = 2; | ||
| private static final int NUM_SERVERS = 3; | ||
|
|
||
|
|
@@ -138,6 +141,7 @@ public void testServerHardFailure() | |
| testCountStarQuery(3, false); | ||
| assertEquals(getCurrentCountStarResult(), expectedCountStarResult); | ||
|
|
||
| LOGGER.warn("Shutting down server " + _serverStarters.get(NUM_SERVERS - 1).getInstanceId()); | ||
| // Take a server and shut down its query server to mimic a hard failure | ||
| BaseServerStarter serverStarter = _serverStarters.get(NUM_SERVERS - 1); | ||
| try { | ||
|
|
@@ -174,7 +178,11 @@ private void testCountStarQuery(int expectedNumServersQueried, boolean exception | |
| assertEquals(exceptions.size(), 2); | ||
| JsonNode firstException = exceptions.get(0); | ||
| assertEquals(firstException.get("errorCode").intValue(), QueryException.BROKER_REQUEST_SEND_ERROR_CODE); | ||
| assertTrue(firstException.get("message").textValue().contains("Connection refused")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel we should't remove this check. Are you removing it in order to pass the test?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The check is incorrect. I think I already wrote about that somewhere, but can I do it here. There is a race condition between the server that is being stopped and the requests that arrive. Normally, the shutdown is executed before, so the error that the later request receives is the expected The correct solution would be to break the race condition by sequentializing the calls. In order to do that the stop request should be blocking. I don't know how to do that and it may introduce some extra complexity on the PR, so I thought it would be better to just do not check the message. We are already checking the error code, which should be good enough. Also, checking error messages is something problematic in general. It may depend, for example, on the locale configured by the used, which would make the tests difficult to reproduce. Instead we should include more specific error codes. |
||
| String firstExceptionMessage = firstException.get("message").textValue(); | ||
| if (!firstExceptionMessage.contains("Connection refused")) { | ||
| LOGGER.warn("first exception message is " + firstExceptionMessage + ", which does not contain " | ||
| + "\"Connection refused\""); | ||
| } | ||
| JsonNode secondException = exceptions.get(1); | ||
| assertEquals(secondException.get("errorCode").intValue(), QueryException.SERVER_NOT_RESPONDING_ERROR_CODE); | ||
| } else { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change this and other introduced
fail-fast: falseonce we are happy with the code