Skip to content

Commit 279dce6

Browse files
author
Andras Beni
committed
Merge remote-tracking branch 'apache/master' into PIP-157
2 parents 904e884 + c85b89b commit 279dce6

File tree

2,684 files changed

+48711
-10554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,684 files changed

+48711
-10554
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+17
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,20 @@ This change added tests and can be verified as follows:
7676

7777
- [ ] `doc-complete`
7878
(Docs have been already added)
79+
80+
### Matching PR in forked repository
81+
82+
PR in forked repository: <!-- ENTER URL HERE
83+
84+
After opening this PR, the build in apache/pulsar will fail and instructions will
85+
be provided for opening a PR in the PR author's forked repository.
86+
87+
apache/pulsar pull requests should be first tested in your own fork since the
88+
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
89+
GitHub Actions provides separate quota for pull requests that are executed in
90+
a forked repository.
91+
92+
The tests will be run in the forked repository until all PR review comments have
93+
been handled, the tests pass and the PR is approved by a reviewer.
94+
95+
-->

.github/workflows/ci-cpp-build.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ concurrency:
3333

3434
jobs:
3535
changed_files_job:
36-
name: 'Changed files check'
36+
name: Preconditions
3737
runs-on: ubuntu-20.04
3838
outputs:
3939
docs_only: ${{ needs.changed_files_job.outputs.docs_only }}
4040
cpp_only: ${{ needs.changed_files_job.outputs.cpp_only }}
41-
changed_tests: ${{ steps.changes.outputs.tests_files }}
4241
steps:
4342
- name: checkout
4443
uses: actions/checkout@v2
@@ -55,6 +54,14 @@ jobs:
5554
run: |
5655
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
5756
57+
- name: Check if the PR has been approved for testing
58+
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
59+
env:
60+
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
61+
GITHUB_TOKEN: ${{ github.token }}
62+
run: |
63+
build/pulsar_ci_tool.sh check_ready_to_test
64+
5865
cpp-build-centos7:
5966
needs: changed_files_job
6067
name: Build CPP Client on CentOS7

.github/workflows/ci-documentbot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ concurrency:
3333

3434
jobs:
3535
label:
36-
if: ${{ github.repository == 'apache/pulsar' }}
36+
if: (github.repository == 'apache/pulsar') && (github.event.pull_request.state == 'open')
3737
permissions:
3838
pull-requests: write
3939
runs-on: ubuntu-20.04

.github/workflows/ci-go-functions.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ env:
3636

3737
jobs:
3838
changed_files_job:
39-
name: 'Changed files check'
39+
name: Preconditions
4040
runs-on: ubuntu-20.04
4141
outputs:
4242
docs_only: ${{ steps.check_changes.outputs.docs_only }}
4343
cpp_only: ${{ steps.check_changes.outputs.cpp_only }}
44-
changed_tests: ${{ steps.changes.outputs.tests_files }}
4544
steps:
4645
- name: checkout
4746
uses: actions/checkout@v2
@@ -57,6 +56,15 @@ jobs:
5756
id: check_changes
5857
run: |
5958
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
59+
echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
60+
61+
- name: Check if the PR has been approved for testing
62+
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
63+
env:
64+
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
65+
GITHUB_TOKEN: ${{ github.token }}
66+
run: |
67+
build/pulsar_ci_tool.sh check_ready_to_test
6068
6169
check-style:
6270
needs: changed_files_job

.github/workflows/pulsar-ci-flaky.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ env:
3737

3838
jobs:
3939
changed_files_job:
40-
name: 'Changed files check'
40+
name: Preconditions
4141
runs-on: ubuntu-20.04
4242
outputs:
4343
docs_only: ${{ steps.check_changes.outputs.docs_only }}
@@ -60,6 +60,14 @@ jobs:
6060
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
6161
echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
6262
63+
- name: Check if the PR has been approved for testing
64+
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
65+
env:
66+
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
67+
GITHUB_TOKEN: ${{ github.token }}
68+
run: |
69+
build/pulsar_ci_tool.sh check_ready_to_test
70+
6371
build-and-test:
6472
needs: changed_files_job
6573
name: Flaky tests suite

.github/workflows/pulsar-ci.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ env:
3737

3838
jobs:
3939
changed_files_job:
40-
name: 'Changed files check'
40+
name: Preconditions
4141
runs-on: ubuntu-20.04
4242
outputs:
4343
docs_only: ${{ steps.check_changes.outputs.docs_only }}
@@ -60,6 +60,14 @@ jobs:
6060
echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
6161
echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
6262
63+
- name: Check if the PR has been approved for testing
64+
if: ${{ steps.check_changes.outputs.docs_only != 'true' && github.repository == 'apache/pulsar' && github.event_name == 'pull_request' }}
65+
env:
66+
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
67+
GITHUB_TOKEN: ${{ github.token }}
68+
run: |
69+
build/pulsar_ci_tool.sh check_ready_to_test
70+
6371
build-and-license-check:
6472
needs: changed_files_job
6573
name: Build and License check
@@ -470,7 +478,7 @@ jobs:
470478
gh-actions-artifact-client.js delete pulsar-java-test-image.zst
471479
472480
cpp-tests:
473-
name:
481+
name: CI - CPP, Python Tests
474482
runs-on: ubuntu-20.04
475483
timeout-minutes: 120
476484
needs: [

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ pulsar-functions/worker/src/test/resources/
2727
.factorypath
2828

2929
# IntelliJ
30-
.idea/
30+
.idea/*
31+
!.idea/vcs.xml
3132
*.iml
3233
*.iws
3334

@@ -48,6 +49,7 @@ target/
4849

4950
# Python
5051
*.pyc
52+
.python-version
5153

5254
# Perf tools
5355
*.hgrm

.idea/vcs.xml

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SECURITY.md

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ It is the responsibility of the security vulnerability handling project team (Ap
1111
## Security Policy details and supported versions of Apache Pulsar
1212

1313
The security policy and supported versions are outlined on the Pulsar website under [Security > Security Policy and Supported Versions](https://pulsar.apache.org/docs/security-policy-and-supported-versions/).
14+
15+
## Security Advisories
16+
17+
Please visit the [Security Advisories](https://github.com/apache/pulsar/wiki/Security-advisories) page.

bin/pulsar

+5-2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,11 @@ if [[ -z "$IS_JAVA_8" ]]; then
300300
# https://github.com/netty/netty/issues/12265
301301
OPTS="$OPTS --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED"
302302
# netty.DnsResolverUtil
303-
# JvmDefaultGCMetricsLogger
304-
OPTS="$OPTS --add-opens java.base/sun.net=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED"
303+
OPTS="$OPTS --add-opens java.base/sun.net=ALL-UNNAMED"
304+
# JvmDefaultGCMetricsLogger & MBeanStatsGenerator
305+
OPTS="$OPTS --add-opens java.management/sun.management=ALL-UNNAMED"
306+
# MBeanStatsGenerator
307+
OPTS="$OPTS --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED"
305308
fi
306309

307310
OPTS="-cp $PULSAR_CLASSPATH $OPTS"

bin/pulsar-shell

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ BINDIR=$(dirname "$PRG")
3434
export PULSAR_HOME=`cd -P $BINDIR/..;pwd`
3535
. "$PULSAR_HOME/bin/pulsar-admin-common.sh"
3636
OPTS="-Dorg.jline.terminal.jansi=false $OPTS"
37+
OPTS="-Dpulsar.shell.working.dir=$(pwd) $OPTS"
3738
DEFAULT_CONFIG="-Dpulsar.shell.config.default=$PULSAR_CLIENT_CONF"
3839

3940
#Change to PULSAR_HOME to support relative paths

bin/pulsar-shell.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ if ERRORLEVEL 1 (
2828
)
2929

3030
set "OPTS=%OPTS% -Dorg.jline.terminal.jansi=false"
31+
set "OPTS=%OPTS% -Dpulsar.shell.config.default=%cd%"
3132
set "DEFAULT_CONFIG=-Dpulsar.shell.config.default="%PULSAR_CLIENT_CONF%""
3233
cd "%PULSAR_HOME%"
3334
"%JAVACMD%" %OPTS% %DEFAULT_CONFIG% org.apache.pulsar.shell.PulsarShell %*

build/pulsar_ci_tool.sh

+75
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,81 @@ function ci_move_test_reports() {
154154
)
155155
}
156156

157+
function ci_check_ready_to_test() {
158+
if [[ -z "$GITHUB_EVENT_PATH" ]]; then
159+
>&2 echo "GITHUB_EVENT_PATH isn't set"
160+
return 1
161+
fi
162+
163+
PR_JSON_URL=$(jq -r '.pull_request.url' "${GITHUB_EVENT_PATH}")
164+
echo "Refreshing $PR_JSON_URL..."
165+
PR_JSON=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" "${PR_JSON_URL}")
166+
167+
if printf "%s" "${PR_JSON}" | jq -e '.draft | select(. == true)' &> /dev/null; then
168+
echo "PR is draft."
169+
elif ! ( printf "%s" "${PR_JSON}" | jq -e '.mergeable | select(. == true)' &> /dev/null ); then
170+
echo "PR isn't mergeable."
171+
else
172+
# check ready-to-test label
173+
if printf "%s" "${PR_JSON}" | jq -e '.labels[] | .name | select(. == "ready-to-test")' &> /dev/null; then
174+
echo "Found ready-to-test label."
175+
return 0
176+
else
177+
echo "There is no ready-to-test label on the PR."
178+
fi
179+
180+
# check if the PR has been approved
181+
PR_NUM=$(jq -r '.pull_request.number' "${GITHUB_EVENT_PATH}")
182+
REPO_FULL_NAME=$(jq -r '.repository.full_name' "${GITHUB_EVENT_PATH}")
183+
REPO_NAME=$(basename "${REPO_FULL_NAME}")
184+
REPO_OWNER=$(dirname "${REPO_FULL_NAME}")
185+
# use graphql query to find out reviewDecision
186+
PR_REVIEW_DECISION=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" -X POST -d '{"query": "query { repository(name: \"'${REPO_NAME}'\", owner: \"'${REPO_OWNER}'\") { pullRequest(number: '${PR_NUM}') { reviewDecision } } }"}' https://api.github.com/graphql |jq -r '.data.repository.pullRequest.reviewDecision')
187+
echo "Review decision for PR #${PR_NUM} in repository ${REPO_OWNER}/${REPO_NAME} is ${PR_REVIEW_DECISION}"
188+
if [[ "$PR_REVIEW_DECISION" == "APPROVED" ]]; then
189+
return 0
190+
fi
191+
fi
192+
193+
FORK_REPO_URL=$(jq -r '.pull_request.head.repo.html_url' "$GITHUB_EVENT_PATH")
194+
PR_BRANCH_LABEL=$(jq -r '.pull_request.head.label' "$GITHUB_EVENT_PATH")
195+
PR_URL=$(jq -r '.pull_request.html_url' "$GITHUB_EVENT_PATH")
196+
FORK_PR_TITLE_URL_ENCODED=$(printf "%s" "${PR_JSON}" | jq -r '"[run-tests] " + .title | @uri')
197+
FORK_PR_BODY_URL_ENCODED=$(jq -n -r "\"This PR is for running tests for upstream PR ${PR_URL}.\n\n<!-- Before creating this PR, please ensure that the fork $FORK_REPO_URL is up to date with https://github.com/apache/pulsar -->\" | @uri")
198+
>&2 tee -a "$GITHUB_STEP_SUMMARY" <<EOF
199+
200+
# Instructions for proceeding with the pull request:
201+
202+
apache/pulsar pull requests should be first tested in your own fork since the apache/pulsar CI based on
203+
GitHub Actions has constrained resources and quota. GitHub Actions provides separate quota for
204+
pull requests that are executed in a forked repository.
205+
206+
1. Go to ${FORK_REPO_URL} and ensure that your branch is up to date with https://github.com/apache/pulsar
207+
Sync your fork if it's behind.
208+
2. Open a pull request to your own fork. You can use this link to create the pull request in
209+
your own fork:
210+
[Create PR in fork for running tests](${FORK_REPO_URL}/compare/master...${PR_BRANCH_LABEL}?expand=1&title=${FORK_PR_TITLE_URL_ENCODED}&body=${FORK_PR_BODY_URL_ENCODED})
211+
3. Edit the description of the pull request ${PR_URL} and add the link to the PR that you opened to your own fork
212+
so that the reviewer can verify that tests pass in your own fork.
213+
4. Ensure that tests pass in your own fork. Your own fork will be used to run the tests during the PR review
214+
and any changes made during the review. You as a PR author are responsible for following up on test failures.
215+
Please report any flaky tests as new issues at https://github.com/apache/pulsar/issues
216+
after checking that the flaky test isn't already reported.
217+
5. When the PR is approved, it will be possible to restart the Pulsar CI workflow within apache/pulsar
218+
repository by adding a comment "/pulsarbot rerun-failure-checks" to the PR.
219+
An alternative for the PR approval is to add a ready-to-test label to the PR. This can be done
220+
by Apache Pulsar committers.
221+
6. When tests pass on the apache/pulsar side, the PR can be merged by a Apache Pulsar Committer.
222+
223+
If you have any trouble you can get support in multiple ways:
224+
* by sending email to the [dev mailing list](mailto:dev@pulsar.apache.org) ([subscribe](mailto:dev-subscribe@pulsar.apache.org))
225+
* on the [#contributors channel on Pulsar Slack](https://apache-pulsar.slack.com/channels/contributors) ([join](https://pulsar.apache.org/community#section-discussions))
226+
* in apache/pulsar [GitHub discussions Q&A](https://github.com/apache/pulsar/discussions/categories/q-a)
227+
228+
EOF
229+
return 1
230+
}
231+
157232
if [ -z "$1" ]; then
158233
echo "usage: $0 [ci_tool_function_name]"
159234
echo "Available ci tool functions:"

buildtools/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<guice.version>4.2.3</guice.version>
5151
<guava.version>31.0.1-jre</guava.version>
5252
<ant.version>1.10.12</ant.version>
53-
<snakeyaml.version>1.31</snakeyaml.version>
53+
<snakeyaml.version>1.32</snakeyaml.version>
5454
<mockito.version>3.12.4</mockito.version>
5555
<!-- required for running tests on JDK11+ -->
5656
<test.additional.args>

conf/broker.conf

+11-1
Original file line numberDiff line numberDiff line change
@@ -1529,12 +1529,22 @@ transactionCoordinatorEnabled=false
15291529
transactionMetadataStoreProviderClassName=org.apache.pulsar.transaction.coordinator.impl.MLTransactionMetadataStoreProvider
15301530

15311531
# Transaction buffer takes a snapshot after the number of transaction operations reaches this value.
1532+
# If transaction buffer enables snapshot segment, transaction buffer updates snapshot metadata
1533+
# after the number of transaction operations reaches this value.
15321534
transactionBufferSnapshotMaxTransactionCount=1000
15331535

1534-
# Transaction buffer take snapshot interval time
1536+
# The interval time for transaction buffer to take snapshots.
1537+
# If transaction buffer enables snapshot segment, it is the interval time for transaction buffer to update snapshot metadata.
15351538
# Unit : millisecond
15361539
transactionBufferSnapshotMinTimeInMillis=5000
15371540

1541+
# Whether to enable segmented transaction buffer snapshot to handle a large number of aborted transactions.
1542+
transactionBufferSegmentedSnapshotEnabled=false
1543+
1544+
# Transaction buffer stores the transaction ID of aborted transactions and takes snapshots.
1545+
# This configuration determines the size of the snapshot segment. The default value is 256 KB (262144 bytes).
1546+
transactionBufferSnapshotSegmentSize=262144
1547+
15381548
# The max concurrent requests for transaction buffer client, default is 1000
15391549
transactionBufferClientMaxConcurrentRequests=1000
15401550

conf/standalone.conf

+11-1
Original file line numberDiff line numberDiff line change
@@ -1119,12 +1119,22 @@ transactionCoordinatorEnabled=false
11191119
transactionMetadataStoreProviderClassName=org.apache.pulsar.transaction.coordinator.impl.MLTransactionMetadataStoreProvider
11201120

11211121
# Transaction buffer takes a snapshot after the number of transaction operations reaches this value.
1122+
# If transaction buffer enables snapshot segment, transaction buffer updates snapshot metadata
1123+
# after the number of transaction operations reaches this value.
11221124
transactionBufferSnapshotMaxTransactionCount=1000
11231125

1124-
# Transaction buffer take snapshot interval time
1126+
# The interval time for transaction buffer to take snapshots.
1127+
# If transaction buffer enables snapshot segment, it is the interval time for transaction buffer to update snapshot metadata.
11251128
# Unit : millisecond
11261129
transactionBufferSnapshotMinTimeInMillis=5000
11271130

1131+
# Whether to enable segmented transaction buffer snapshot to handle a large number of aborted transactions.
1132+
transactionBufferSegmentedSnapshotEnabled=false
1133+
1134+
# Transaction buffer stores the transaction ID of aborted transactions and takes snapshots.
1135+
# This configuration determines the size of the snapshot segment. The default value is 256 KB (262144 bytes).
1136+
transactionBufferSnapshotSegmentSize=262144
1137+
11281138
# The transaction buffer client's operation timeout in milliseconds.
11291139
transactionBufferClientOperationTimeoutInMills=3000
11301140

distribution/server/src/assemble/LICENSE.bin.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ The Apache Software License, Version 2.0
454454
- org.eclipse.jetty.websocket-websocket-servlet-9.4.48.v20220622.jar
455455
- org.eclipse.jetty-jetty-alpn-conscrypt-server-9.4.48.v20220622.jar
456456
- org.eclipse.jetty-jetty-alpn-server-9.4.48.v20220622.jar
457-
* SnakeYaml -- org.yaml-snakeyaml-1.31.jar
457+
* SnakeYaml -- org.yaml-snakeyaml-1.32.jar
458458
* RocksDB - org.rocksdb-rocksdbjni-6.29.4.1.jar
459459
* Google Error Prone Annotations - com.google.errorprone-error_prone_annotations-2.5.1.jar
460460
* Apache Thrift - org.apache.thrift-libthrift-0.14.2.jar
@@ -547,6 +547,8 @@ The Apache Software License, Version 2.0
547547
- io.reactivex.rxjava3-rxjava-3.0.1.jar
548548
* RabbitMQ Java Client
549549
- com.rabbitmq-amqp-client-5.5.3.jar
550+
* RoaringBitmap
551+
- org.roaringbitmap-RoaringBitmap-0.9.15.jar
550552

551553
BSD 3-clause "New" or "Revised" License
552554
* Google auth library

0 commit comments

Comments
 (0)