commit | 7c96a36c58768e71cc445371bb3d98c5ac6e05cd | [log] [tgz] |
---|---|---|
author | fengyubiao <yubiao.feng@streamnative.io> | Mon Aug 21 04:49:30 2023 +0800 |
committer | GitHub <noreply@github.com> | Mon Aug 21 04:49:30 2023 +0800 |
tree | bbcd1a06c9fafe010884fb84629d648183368640 | |
parent | 00ca6aa1cef950bd9ea5014d4332d16d3c8d37e2 [diff] |
[fix] [admin] Fix get topic stats fail if a subscription catch up concurrently (#20971) ### Motivation **Background**: when calling `pulsar-admin topics stats --get-earliest-time-in-backlog <topic name>`, Pulsar will read the first entry which is not acknowledged, and respond with the entry write time. The flow is like this: - get the mark deleted position of the subscription - if no backlog, response `-1` - else read the next position of the mark deleted position, and respond with the entry write time. **Issue**: if the command `pulsar-admin topics stats --get-earliest-time-in-backlog <topic name>` and `consumer.acknowledge` are executed at the same time, the step 2 in above flow will get a position which is larger than the last confirmed position, lead a read entry error. | time | `pulsar-admin topics stats --get-earliest-time-in-backlog <topic name>` | `consumer.acknowledge` | | --- | --- | --- | | 1 | mark deleted position is `3:1` and LAC is `3:2` now | | 2 | the check `whether has backlog` is passed | | 3 | | acknowledged `3:2`, mark deleted position is `3:2` now | | 4 | calculate next position: `3:3` | | 5 | Read `3:3` and get an error: `read entry failed` | Note: the test in PR is not intended to reproduce the issue. ### Modifications Respond `-1` if the next position of the mark deleted position is larger than the LAC
Pulsar is a distributed pub-sub messaging platform with a very flexible messaging model and an intuitive client API.
Learn more about Pulsar at https://pulsar.apache.org
This repository is the main repository of Apache Pulsar. Pulsar PMC also maintains other repositories for components in the Pulsar ecosystem, including connectors, adapters, and other language clients.
Components | Java Version |
---|---|
Broker | 17 |
Functions / IO | 17 |
CLI | 17 |
Java Client | 8 or 11 or 17 |
Components | Java Version |
---|---|
Broker | 11 |
Functions / IO | 11 |
CLI | 8 or 11 |
Java Client | 8 or 11 |
Components | Java Version |
---|---|
All | 8 or 11 |
Note:
This project includes a Maven Wrapper that can be used instead of a system-installed Maven. Use it by replacing
mvn
by./mvnw
on Linux andmvnw.cmd
on Windows in the commands below.It's better to use CMD rather than Powershell on Windows. Because maven will activate the
windows
profile which runsrename-netty-native-libs.cmd
.
Compile and install:
$ mvn install -DskipTests
Compile and install individual module
$ mvn -pl module-name (e.g: pulsar-broker) install -DskipTests
mvn install -Pcore-modules,-main -DskipTests
Run Unit Tests:
$ mvn test
Run Individual Unit Test:
$ mvn -pl module-name (e.g: pulsar-client) test -Dtest=unit-test-name (e.g: ConsumerBuilderImplTest)
Run Selected Test packages:
$ mvn test -pl module-name (for example, pulsar-broker) -Dinclude=org/apache/pulsar/**/*.java
Start standalone Pulsar service:
$ bin/pulsar standalone
Check https://pulsar.apache.org for documentation and examples.
branch-2.7
or previous branches because of ISSUE-8445.branch-2.8
, branch-2.9
and branch-2.10
.master
.The following command builds the docker images apachepulsar/pulsar-all:latest
and apachepulsar/pulsar:latest
:
mvn clean install -DskipTests mvn package -Pdocker,-main -am -pl docker/pulsar-all -DskipTests
After the images are built, they can be tagged and pushed to your custom repository. Here's an example of a bash script that tags the docker images with the current version and git revision and pushes them to localhost:32000/apachepulsar
.
image_repo_and_project=localhost:32000/apachepulsar pulsar_version=$(mvn initialize help:evaluate -Dexpression=project.version -pl . -q -DforceStdout) gitrev=$(git rev-parse HEAD | colrm 10) tag="${pulsar_version}-${gitrev}" echo "Using tag $tag" docker tag apachepulsar/pulsar-all:latest ${image_repo_and_project}/pulsar-all:$tag docker push ${image_repo_and_project}/pulsar-all:$tag docker tag apachepulsar/pulsar:latest ${image_repo_and_project}/pulsar:$tag docker push ${image_repo_and_project}/pulsar:$tag
Read https://pulsar.apache.org/contribute/setup-ide for setting up IntelliJ IDEA or Eclipse for developing Pulsar.
Note:
For how to make contributions to Pulsar documentation, see Pulsar Documentation Contribution Guide.
Name | Scope | Subscribe | Unsubscribe | Archives |
---|---|---|---|---|
users@pulsar.apache.org | User-related discussions | Subscribe | Unsubscribe | Archives |
dev@pulsar.apache.org | Development-related discussions | Subscribe | Unsubscribe | Archives |
Pulsar slack channel at https://apache-pulsar.slack.com/
You can self-register at https://communityinviter.com/apps/apache-pulsar/apache-pulsar
To report a vulnerability for Pulsar, contact the Apache Security Team. When reporting a vulnerability to security@apache.org, you can copy your email to private@pulsar.apache.org to send your report to the Apache Pulsar Project Management Committee. This is a private mailing list.
https://github.com/apache/pulsar/security/policy contains more details.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See The Wassenaar Arrangement for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.
The following provides more details on the included cryptographic software: Pulsar uses the SSL library from Bouncy Castle written by http://www.bouncycastle.org.