Repository navigation
Conversation
lhotari
commented
Jan 27, 2021
Owner
- this is a dummy PR to the fork to active the Github Actions workflows with Gradle Build scans enabled
### Motivation Generate full amount of documentation for version 2.7.0, release manager run the `yarn run version <release-version>` command to generate the full amount of documentation. ### Modifications * Add a script `docusaurus-version.js` * Update command `yarn run version` * Generate full docs for pulsar 2.7.0
### Motivation In out build environment (MagNews.com) we are upgrading Swagger to 1.6.2, as it is also used by Pulsar Builder system we would like to upgrade Swagger here as well. Even if Swagger is used for documentation, swagger-core is a runtime dependency so it is better to guarantee that Pulsar is working well with latest version of Swagger 1.X. I am also upgrading the Maven Swagger Plugin to 3.1.7, the 3.1.8 is buggy and it fails the build with NPE (the same problem occurs even in MagNews build, so it is not related to Pulsar itself) ### Modifications - Upgrade Swagger version to 1.6.2 - Upgrade Maven Plugin to 3.1.7
…admin API namespace doc (apache#8760) Fixes https://github.com/streamnative/pulsar/issues/1639 ### Motivation To specify how soon after message acknowledgement can we expect the message to be deleted - is it immediate or is there some asynchronous cleanup process. ### Modifications 1: Add "delete data from namespaces" for master release. Once the PR is approved, will sync update to previous releases. 2: Reorg the Admin API for namespace doc as some section titles are missed.
…8878) Fix issue: https://github.com/streamnative/pulsar/issues/1768 This PR contains code style changes only, it will be the final patch to make module `pulsar-broker` conform checkstyle.
apache#8883) Describe the bug It looks like GenericJsonReader is not handling correctly null values Expected behavior The null value is not converted to a string, but it is still a null value Changes - Handle correctly null values - add test case Additional context The problem affects Pulsar Functions/Pulsar IO Fixes apache#8882
Master Issue: apache#8853 ### Motivation This pr adds a `[[pulsar.version_number]]` field to restapi in documentation after 2.3.0, and fixes the build script. ### Modifications * Add `pulsar.version_number` * Fixed replace script ### Verifying this change - [ ] Make sure that the change passes the CI checks. After building the script:  
--- *Motivation* We have some CIs are not using the latest image for running integration tests. We should always build the latest image using the current code to run the integration tests. *Modifications* - Add build docker steps in the ci files
…nd batch-data-generator (apache#8889) Thanks for your contribution
--- Master Issue: apache#8676 *Motivation* Add integration tests for testing the whole package management service. *Modifications* - Add integration tests - Fix some issue when startup the package management service
### Motivation This is an update after apache#8888, where `functions` should jump to `/functions-rest-api`, `source` should jump to `/source-rest-api`, `sink` should jump to `/sink-rest-api` ### Modifications * Update route jump * Update markdown content render
…ndency with log4j-1.2-api (apache#8880) - import Log4j2's BOM into Pulsar's dependency management instead of defining versions separately for each Log4j2 library - distribution/server/pom.xml included log4j:log4j dependency. - replace with org.apache.logging.log4j:log4j-1.2-api to keep supporting the legacy logging api in the case something depends on it
### Motivation Google's [Error Prone static code analysis tool](https://errorprone.info/) can detect typical programming mistakes (for more info see https://errorprone.info/). This PR adds configuration to Pulsar maven build so that Error Prone static code analysis can be run for the Pulsar code base. This additional configuration is not active by default and requires activating `errorprone` and `errorprone-jdk8` or `errorprone-jdk11` maven profiles in addition to `main` or `core-modules` profile for running the analysis. ### Modifications - add a separate maven profile for running errorprone analysis it is not active by default - Add top-level `lombok.config file` for configuring Lombok. This file doesn't contain any other settings that marks it as the top most config file with `config.stopBubbling = true` (see https://projectlombok.org/features/configuration for reference) - Before running the Error Prone analysis, it's necessary to manually configure Lombok to add `@javax.annotation.Generated("lombok")` annotation on all fields, methods, and types that are generated. This makes Error Prone skip the analysis for Lombok generated code. - this setting cannot be enabled by default since JDK9+ doesn't include the `javax.annotation.Generated` annotation by default and adding the required dependency will change the classpath dependency resolution results. - There is an open issue to support lombok.Generated annotion in ErrorProne, google/error-prone#1863 - example usage: Configure Lombok to add Generated annotations `echo "lombok.addJavaxGeneratedAnnotation = true" >> lombok.config` then, on JDK8 `mvn -Perrorprone,errorprone-jdk8,core-modules compile` on JDK11+ `mvn -Perrorprone,errorprone-jdk11,core-modules compile` - usability is better when used together with IntelliJ since one can click on the error message to navigate to the code location - also add configuration for Error Prone SLF4J plugin https://github.com/KengoTODA/errorprone-slf4j which helps detect misusage of SLF4J API
…am Sinks (apache#8854) ## Changes: - extract original Schema from the message read from the topic - expose the schema into the PulsarRecord implementation - add unit test - in PulsarSink detect the fact that the source record is directly from a PulsarSource and drop the schema (there was already a check about the fact that the source record is a PulsarRecord, so this patch is not adding a new shortcircuit) - little refactor in PulsarSink in order to make it clear that we are working with SinkRecord (casts were already present in the code, and it would not have worked without SinkRecord, so we are only tidying it up) ### Motivation Pulsar sinks cannot access the original Schema of the Message they are consuming, this is because currently PulsarSource does not publish the Schema information to downstream processing. ### Modifications Try to retrieve Schema information from the Message and push it down to the Record. ### Verifying this change - [X] Make sure that the change passes the CI checks. - [X] This change added tests and can be verified as follows: - added unit test - tested manually with Pulsar Standalone - there are existing unit and integration tests that are touching this change (in fact I had to iterate a few times) ### Does this pull request potentially affect one of the following parts: yes with this change Pulsar function users and especially Pulsar I/O Sinks will be able to inspect the original schema in case the processing starts from a Pulsar topic (PulsarSource)
…apache#8903) Master Issue: apache#8843 ### Motivation Enable spotbugs for the pulsar-io module. ### Modifications Enable soptbugs for pulsar-io/core, pulsar-io/common, pulsar-io/docs. ### Verifying this change ``` mvn clean install -pl pulsar-io/core mvn clean install -pl pulsar-io/common mvn clean install -pl pulsar-io/docs ```
…IntelliJ (apache#8892) ### Motivation The current instructions to setup Pulsar development in IntelliJ could be improved. ### Modifications Update README.md * improved instructions for Pulsar development in IntelliJ * update the information that building Pulsar with newer than Java 8 has issues (see the changes for details)
Signed-off-by: xiaolong.ran <[email protected]> Fixes apache#6527 ### Motivation We already support `key_shared` mode on Pulsar Functions in apache#7647, However, this option is not exposed in the command line parameters, so users currently cannot use this function. ### Modifications In this pull request, we expose this cmd flag of `--retain-key-ordering` and add the docs for this. ### Verifying this change The original test can cover this option, so, in this change, no relevant code is added
…oid deadlocks (apache#8877) ### Motivation Some of our broker servers experienced what appears to be a deadlock. The following is the thread dump at that time. [threaddump.txt.zip](https://github.com/apache/pulsar/files/5665572/threaddump.txt.zip) The thread "ForkJoinPool.commonPool-worker-120" was locking an instance of `ManagedLedgerImpl`. And this thread seemed to be waiting for `subscriptions`, which is an instance of `ConcurrentOpenHashMap`, to be unlocked. Many other threads were blocked because the lock on the `ManagedLedgerImpl` instance was not released. ``` "ForkJoinPool.commonPool-worker-120" apache#903 daemon prio=5 os_prio=0 tid=0x00007f9aa0010000 nid=0x12b59 waiting on condition [0x00007f9528cc3000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00007fa20b3e5eb0> (a org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap$Section) at java.util.concurrent.locks.StampedLock.acquireWrite(StampedLock.java:1119) at java.util.concurrent.locks.StampedLock.writeLock(StampedLock.java:354) at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap$Section.put(ConcurrentOpenHashMap.java:245) at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap.computeIfAbsent(ConcurrentOpenHashMap.java:129) at org.apache.pulsar.broker.service.persistent.PersistentTopic$2.openCursorComplete(PersistentTopic.java:650) at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.asyncOpenCursor(ManagedLedgerImpl.java:720) - locked <0x00007fa20512f968> (a org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl) at org.apache.pulsar.broker.service.persistent.PersistentTopic.getDurableSubscription(PersistentTopic.java:643) at org.apache.pulsar.broker.service.persistent.PersistentTopic.subscribe(PersistentTopic.java:590) at org.apache.pulsar.broker.service.ServerCnx.lambda$null$10(ServerCnx.java:699) at org.apache.pulsar.broker.service.ServerCnx$$Lambda$476/1880414247.apply(Unknown Source) at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:995) at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2137) at org.apache.pulsar.broker.service.ServerCnx.lambda$null$13(ServerCnx.java:682) at org.apache.pulsar.broker.service.ServerCnx$$Lambda$475/707554512.apply(Unknown Source) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:616) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:591) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:575) at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:943) at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:457) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ``` The thread that locked `subscriptions` seems to be "pulsar-msg-expiry-monitor-24-1". ``` "pulsar-msg-expiry-monitor-24-1" #304 prio=5 os_prio=0 tid=0x00007f99602dd000 nid=0x12036 waiting on condition [0x00007f998d47c000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00007fca4361dfb0> (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1037) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1328) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:277) at org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.getNthEntry(ManagedCursorImpl.java:537) at org.apache.pulsar.broker.service.persistent.PersistentTopic.isOldestMessageExpired(PersistentTopic.java:1820) at org.apache.pulsar.broker.service.persistent.PersistentSubscription.expireMessages(PersistentSubscription.java:901) at org.apache.pulsar.broker.service.persistent.PersistentTopic.lambda$checkMessageExpiry$36(PersistentTopic.java:1102) at org.apache.pulsar.broker.service.persistent.PersistentTopic$$Lambda$1011/2104832020.accept(Unknown Source) at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap$Section.forEach(ConcurrentOpenHashMap.java:385) at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap.forEach(ConcurrentOpenHashMap.java:159) at org.apache.pulsar.broker.service.persistent.PersistentTopic.checkMessageExpiry(PersistentTopic.java:1102) at org.apache.pulsar.broker.service.BrokerService$$Lambda$1009/2005752676.accept(Unknown Source) at org.apache.pulsar.broker.service.BrokerService.lambda$forEachTopic$32(BrokerService.java:951) at org.apache.pulsar.broker.service.BrokerService$$Lambda$779/1852910990.accept(Unknown Source) at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap$Section.forEach(ConcurrentOpenHashMap.java:385) at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap.forEach(ConcurrentOpenHashMap.java:159) at org.apache.pulsar.broker.service.BrokerService.forEachTopic(BrokerService.java:948) at org.apache.pulsar.broker.service.BrokerService.checkMessageExpiry(BrokerService.java:925) at org.apache.pulsar.broker.service.BrokerService$$Lambda$108/203149502.run(Unknown Source) at org.apache.bookkeeper.mledger.util.SafeRun$1.safeRun(SafeRun.java:32) at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748) ``` I can't understand why "pulsar-msg-expiry-monitor-24-1" was stuck. However, it seems that this deadlock can be avoided if `subscriptions` is not locked when checking for message expiration, so I created this PR. If anyone can explain why "pulsar-msg-expiry-monitor-24-1" was stuck, please let me know. ### Modifications When expiring messages for each subscription, copy the values of `subscriptions` as `List` and execute `forEach()` for that `List` instance.
--- Master Issue: apache#8676 *Motivation* Show REST API examples in the website. *Modifications* Add website related changes for package management REST APIs. *ScreenShot* 
…e#8746) fix apache#8533 , modified only issue-related method, may need to change all calls in this section to asynchronous later.
…#8908) ### Motivation Profiling a 3 node Pulsar cluster running with 2.7.0 version showed allocation hotspots in `log.debug` methods. This indicated that the root logger level was set to debug. ### Modifications - Configure the root log level in `bin/pulsar` startup script to use `info` level by default. This can be done by setting the `pulsar.log.root.level` system property. - since the root log level was debug, all code blocks within `log.isDebugEnabled()` got executed. This caused a lot of unnecessary memory allocations and wasted CPU cycles.
Fixes apache#8573 ### Motivation Some users who want to know how many messages are expired at what time? Currently, these metrics are too few, so that TTL looks like a black box, unobservable ### Modifications add `totalMsgExpired`、`lastExpireTimestamp`、`msgRateExpired` for Prometheus metric ### Verifying this change PrometheusMetricsTest.java
Fixes apache#8872 ### Motivation When users configure authParam, some errors occur ### Modifications Try to configure the authParam as JSON
Fix apache#8509 Changes add Secret interface and SecretsSerializer for fields need to be shown in secret string(*****) when log to json string add Secret tag for authParams and authParamMap in ClientConfiguration add a test for the secret feature * fix authParams showing in log with secret string(*****) * format code
… 2.7.0--2.6.0 (apache#8934) ### Motivation This PR is a follow-up PR for apache#8760, in which only master doc is updated. This PR is used to sync doc updates for releases 2.6.0--2.7.0, including minor releases. Updates in master release have been reviewed and approved. You can just approve it directly. ### Modifications Add a section in cook-retention policy for deleting data from namespace.
…policy (apache#8924) Master Issue: apache#8866 ### Motivation Currently, apache#8289 introduced max subscriptions per topic at the broker level but does not support overwrite on the namespace level ### Modifications Add api for namespace-level policy ### Verifying this change AdminApiTest2.java 1) Verify that the basic API is correct 2) Verify that the restriction is in effect 3) Verify the priority of namespace level and broker level
…che#8618) Fixes apache#8617 ## Motivation Introduce lightweight raw Message metadata, details can be found PIP-70 ## Modifications wire protocol add RawMessageMetadata and supports_raw_message_meta for FeatureFlags change how produced message is saved in bookkeeper: add raw metadata for message change how message is seek-by-time change how message send back to Consumer: skip metadata if consumer not supprot raw metadata Verifying this change Added tests for parse/skip raw message metadata Added test for how message seek-by broker timestamp for message
Master Issue: apache#8533 Motivation Fix the project style error introduced by apache#8533 Co-authored-by: Sijie Guo <[email protected]>
…" issues (apache#8921) ### Motivation PR apache#8386 configured the http connection pooling timeout to 25 seconds. However the "connection reset" issue with maven dependency downloads has persisted. he mitigation used in other projects is to disable maven's http connection pooling completely. The solution is proposed here: - actions/runner-images#1499 (comment) ### Modifications Disable maven's http connection pool by passing `-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false` in `MAVEN_OPTS` environment variable.
…fig (apache#8918) ### Motivation Fixes apache#8911, compiling a sub module individually in the sub module directory Previously, the maven build failed if executed in other than the root directory if the license or checkstyle checks were run since those plugins weren't able to find their configuration. ### Modifications - use proposed solution of https://stackoverflow.com/a/37965143 to set a property `pulsar.basedir` which contains the absolute path to the root directory - all other solutions don't seem to work universally in all projects, for example `project.parent.basedir` isn't available in the root project and not all projects necessarily have the root project as their parent project. - when running `license:check` or `checkstyle:checkstyle` directly, it is necessary to add `initialize` phase to the command line, since the `pulsar.basedir` property gets set in the `initialize` phase. for example: `mvn initialize license:check` or `mvn initialize checkstyle:checkstyle` - This should be fine since the maven best practice is to use lifecycle phases such as `mvn verify` instead of listing plugin goals on the command line.
* fix icon * fix broker link
…pache#9255) ### Motivation Fix peek message metadata broker while enable broker entry metadata. When enabled the broker entry metadata, following error occurs: ``` 22:09:57.802 [broker-topic-workers-OrderedScheduler-4-0:org.apache.pulsar.common.protocol.Commands@1658] ERROR org.apache.pulsar.common.protocol.Commands - [PersistentSubscription{topic=persistent://public/default/__consumer_offsets-partition-0, name=reader-31a9742e6c}] [-1] Failed to parse message metadata java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6 at org.apache.pulsar.common.api.proto.LightProtoCodec.skipUnknownField(LightProtoCodec.java:270) ~[pulsar-common-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.common.api.proto.MessageMetadata.parseFrom(MessageMetadata.java:1370) ~[pulsar-common-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:425) ~[pulsar-common-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:415) ~[pulsar-common-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.common.protocol.Commands.peekMessageMetadata(Commands.java:1653) ~[pulsar-common-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.broker.service.AbstractBaseDispatcher.filterEntriesForConsumer(AbstractBaseDispatcher.java:82) ~[pulsar-broker-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer.internalReadEntriesComplete(PersistentDispatcherSingleActiveConsumer.java:232) ~[pulsar-broker-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.pulsar.broker.service.persistent.PersistentDispatcherSingleActiveConsumer.lambda$readEntriesComplete$1(PersistentDispatcherSingleActiveConsumer.java:178) ~[pulsar-broker-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.bookkeeper.mledger.util.SafeRun$1.safeRun(SafeRun.java:32) [managed-ledger-2.8.0-rc-202101192246.jar:2.8.0-rc-202101192246] at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-common-4.12.1.jar:4.12.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_261] at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [?:1.8.0_261] at java.util.concurrent.FutureTask.run(FutureTask.java) [?:1.8.0_261] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_261] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_261] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_261] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_261] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.51.Final.jar:4.1.51.Final] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261] ``` The root cause is peeking message metadata does not skip the broker entry metadata.
## Motivation in order to handle the transaction timeout. when aborting and committing finish we should change the status in transaction coordinator. ## implement 1. add the transaction timeout tracker factory 2. add the transaction timeout tracker 3. use HashedWheelTimer to implement it.
Master Issue: apache#9216 ### Modifications add applied API ### Verifying this change Test whether the API works: testGetMaxProducerApplied
…pache#9289) ### Motivation For Pulsar Functions / IO, don't attempt to clean up packages when Source/Sink is builtin. Though it doesn't really cause any problems even if we do just a nasty exception gets logged.
…he#9287) Fixes apache#9176 ### Motivation Currently Python producer's send method returns nothing. However, it should returns a `MessageId` at least. ### Modifications - Add a new `Producer#send` API with an extra argument as the output argument of `MessageId`. - Improve the `Producer#send` related documents to ensure these methods can link to each other in Doxygen-generated websites. - Let Python client's `Producer#send` return a `MessageId`. - Add related tests. It should be noted that the current C++ `Producer::send`'s API design is strange and weird that it returns no `MessageId` explicitly. However it will set the input `Message`'s internal `MessageId` field and there're no document about it, as well as the tests. This API design is extremely terrible. I think without looking into the source code, no one could guess that the input **const** `Message` argument will **modify** its internal field after `send` is completed. So I add a new `send` method as a substitute and mark the old `send` method deprecated.
…#9257) ### Motivation [PIP-70](https://github.com/apache/pulsar/wiki/PIP-70%3A-Introduce-lightweight-broker-entry-metadata) introduced lightweight broker entry metadata which is added by related interceptor like `AppendBrokerTimestampMetadataInterceptor` before being written to bookie asynchronously. However, in the callback when entries are written to bookie successfully, the caller side can only get the ledger id and entry id, see `PublishContext#completed`: ```java void completed(Exception e, long ledgerId, long entryId); ``` Currently there's no way to get the broker entry data in publish callback. We can access the interceptor's internal field but it may be overwritten by the next entry's broker entry metadata because the interceptor changes the internal fields when the entry was sent while the callback is invoked when the send is done. This PR intends to expose the entry's data to callbacks, including managed ledger's add callback and the publish context's complete callback. If we want to make use of broker entry metadata or the old message metadata in future, we can use the new callbacks. ### Modifications - Add an extra `ByteBuf` argument to `AddEntryCallback#addComplete` to expose the entry data. - Add a default method `setMetadataFromEntryData` to `PublishContext` interface to allow implementer side retrieve some metadata from entry data. - Add tests for `AddEntryCallback#addComplete`. - Add tests for `PublishContext#setMetadataFromEntryData`.
…pache#9192) Fixes apache#9183 ### Motivation Pulsar functions document for Kubernetes runtime missing some configs, such as `changeConfigMap`, `changeConfigMapNamespace`, etc. This pr add the missing parameters' documents, and `functions_worker.yml` as well. ### Modifications - add documents to `functions-runtime.md` - align the paramters to `functions_worker.yml`
### Motivation Currently, if many clients are failing to authenticate, it might not be clear as to the reason why. For JWT auth for example, it could be because the JWT failed to validate, or that a token is expired. In a busy system, these messages are too noisy to log, so we should instead consider metrics that provide info on successful vs failed auths, as well as auth failure reasons ### Modifications * Implement `AuthenticationMetrics` API that allows for instrumenting auth success, and auth failures, with a Prometheus compatible attribute used to distinguish failure reasons. * Add auth metrics instrument to the `basic auth`, `jwt auth`, `tls auth`, `athenz auth` and `sasl auth`.
This PR contains the new interface and implementation of the offloader in the below PIP Unit test is still in progress - [x] StreamingDataBlockHeaderImpl - [x] StreamingBlobStoreBackedReadHandleImpl - [x] BufferedOffloadStream - [x] BlobStoreManagedLedgerOffloader - [x] StreamingOffloadIndexBlock PIP 76: https://github.com/apache/pulsar/wiki/PIP-76:-Streaming-Offload
…9245) Master Issue: apache#9216 ### Modifications add applied API for client ### Verifying this change unit test: adminApiDelayedDelivery.testNamespaceDelayedDeliveryPolicyApi adminApiDelayedDelivery.testDelayedDeliveryApplied
Fixes apache#9265 ### Motivation If disabled the topic auto-creation, the system topic under the namespace also not able to be created automatically, this will result in the topic level policy not able to use. ### Modifications Make the system topic be automatically created at any time
…nce (apache#9304) Co-authored-by: Jerry Peng <[email protected]>
Fixes streamnative/pulsar#1797 ### Motivation Enable spotbugs in module pulsar-metadata.
apache#9215) Fixes apache#9205 ### Motivation In apache#9108, we add some topic-level policies commands, and found some commands are not consistent with that for namespace-level. For example, On namespace-level, the policies commands are: ``` get-max-producers set-max-producers remove-max-producers get-max-unacked-messages-per-subscription set-max-unacked-messages-per-subscription remove-max-unacked-messages-per-subscription ``` On topic-level, the polices commands are: ``` get-maxProducers set-maxProducers remove-maxProducers get-max-unacked-messages-on-subscription set-max-unacked-messages-on-subscription remove-max-unacked-messages-on-subscription ``` ### Modifications Keep topic-level policies commands consistent with that for namespace
### Motivation In our current code, complete in offloading context may set true even sync metadata to Zookeeper failed, which may lead to more fatal error like data in Bookkeeper will be deleted but other managed ledger will see data not offloaded and try to read from Bookkeeper. ### Modification This PR make sure local ledger info will be updated after Zookeeper updated. * prevent ledgers info change without write to zk succeed * add unit test to prevent fake positive when offload failed
* Add refresh authentication command in the broker --- **Motivation** Some authentication provider is using cached authentication data. Until redoing the 'getAuthData' then it will provide the new auth data. So I add a refresh command and do the refresh authentication data provider when received the command. **Verify this change** Existent tests can pass.
Master Issue: apache#9187 ### Motivation Currently, `brokerClientAuthenticationParameters` does not support being set via JSON formatted string, like: ``` brokerClientAuthenticationParameters={"token":"token-string"} ``` This PR Add support for the JSON format token setting. ### Modifications * Add support for the JSON format token ### Verifying this change This change is already covered by existing tests, such as *testAuthTokenConfigFromJson*.
…he#9286) * Refactor PulsarClient initialization and lifecycle management in tests * Add getter and setter to access remoteEndpointProtocolVersion field - it makes it easier to override for tests * Add hooks for overriding the producer implementation in PulsarClientImpl - useful for tests. Instead of relying on Mockito, there's a pure Java way to inject behavior to producer implementations for testing purposes * Introduce PulsarTestClient that contains ways to prevent race conditions and test flakiness - provides features for simulating failure conditions, for example the case of the broker connection disconnecting * Add solution for using Enums classes as source for TestNG DataProvider * Fix flaky MessageIdTest and move checksum related tests to new class * Fix NPE in PartitionedProducerImplTest
Co-authored-by: Enrico Olivelli <[email protected]>
…he#9309) Our default configuration file for log4j includes and example about how to use Javascript based filters. Enabling that lo4j feature forces log4j runtime to perform Nashorn JS engine initialisation, this basically slows down pulsar-admin startup. When you run on JDK11+ you also see a warning "Warning: Nashorn engine is planned to be removed from a future JDK release" that is very annoying for users. This change is part of a little series of patches about improving pulsar-admin startup speed
* Normalize variable reference style and replace backticks with `$()`. * Double quote parameter expansions in case e.g. ROOT_DIR has spaces. Fixes apache#7714
- by passing `-Dgradle.user.config=.mvn/gradle-enterprise-ci.xml` in MAVEN_OPTS
lhotari
pushed a commit
that referenced
this pull request
Jun 23, 2021
lhotari
added a commit
that referenced
this pull request
Jul 4, 2026
…SslContexts (PIP-478 FIX-6) Motivation: apply PIP-478's own anti-kitchen-sink philosophy (Motivation #2/apache#4) to the TLS util layer. The generic org.apache.pulsar.common.util.SecurityUtility grab-bag mixes three unrelated concerns (PEM parsing, JCA/JCE provider resolution, JDK SSLContext assembly) plus dead legacy Netty/rotation helpers. SecurityUtility carries no @InterfaceStability and has no client-api importer, so it is internal and safe to decompose. Modifications: introduce three single-concern containers in a new package org.apache.pulsar.common.util.tls (kept out of the dependency-light pulsar-common-api; these pull BouncyCastle/Netty), each holding exactly one concern lifted verbatim from SecurityUtility: - PemReader — loadCertificatesFromPemFile/Stream + loadPrivateKeyFromPemFile/Stream. - JcaProviders — getProvider/isBCFIPS + BC/Conscrypt provider constants and the Conscrypt hostname-verifier workaround; resolveProvider and the TrustManager processing are package-private (only JdkSslContexts uses them). - JdkSslContexts — createSslContext(...) JDK SSLContext assembly, composing PemReader, JcaProviders and the existing KeyStoreHolder. This commit is purely additive; SecurityUtility is untouched and still compiles. Callers migrate in the follow-up commit, and SecurityUtility (plus the dead helpers) is removed after that. New package uses org.apache.pulsar.common.util.tls (not ...common.tls) to avoid a split package with pulsar-common-api's org.apache.pulsar.common.tls. Assisted-by: Claude Code (Opus 4.8)
lhotari
added a commit
that referenced
this pull request
Jul 4, 2026
…8 A-H1/G-IS2) Motivation: In-Scope #2 promises "implement a v5 Authentication, deploy it by class name". It didn't work: every reflective load blind-cast the loaded class to the v4 org.apache.pulsar.client.api.Authentication, so a class implementing only the v5 SPI threw ClassCastException. The flagship story worked only when the instance was passed programmatically. Modifications: - New V5AuthenticationLoader detects a v5-native Authentication class (org.apache.pulsar.client.api.v5.auth.Authentication.isAssignableFrom): it is instantiated no-arg and configured with the parsed authParams (JSON object or key:val,key:val, matching AuthenticationUtil), then returned directly. A legacy v4 class keeps the existing path (AuthenticationUtil.create + wrap), preserving raw-string handling for EncodedAuthenticationParameterSupport. - PulsarClientProviderV5.createAuthentication (both overloads) route through it, so AuthenticationFactory.create(className, params) is v5-aware. - PulsarClientBuilderV5.authentication(className, paramsString) now eagerly builds the plugin (mirroring v4 ClientBuilderImpl) and exposes a v5-native one through V5ToV4AuthenticationAdapter, while still recording the serializable authPluginClassName + authParams form. Test: V5AuthenticationLoaderTest — a fake v5-native SinglePassAuthentication loaded by name has configure() called (key:val and JSON forms, and the map overload) and drives the binary transport through the adapter; a v4 class still loads through LegacyV4AuthenticationAdapter; blank name yields disabled auth. Assisted-by: Claude Code (Opus 4.8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.