GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — [feat][ml] Port batch read and managed-ledger cache improvements (PIP-430) on BK 4.17.4.1 by dao-jun · Pull Request #105 · ascentstream/pulsar Conversation
|
| Upstream | Reason |
|---|---|
| apache#26598 (open ledgers via builder API) | withKeepUpdateMetadata is 4.18-line only; the base's 6-arg asyncOpenLedger(..., true) already preserves ledger properties (semantically equivalent), so the builder migration is dropped entirely |
| apache#26574 (BK 4.18.1) | no 4.18 upgrade in this variant |
| apache#26514 (Netty 4.2.18) | no Netty 4.2 upgrade in this variant |
slog bundling into java-instance.jar |
BK 4.17.4.x allocator uses slf4j; the NCDFE root cause does not exist |
| Drop Shade on Java 8/11 matrix | motivated by BK 4.18's Java 17 bytecode; not applicable here |
pulsar-common allocator code ([feat][misc] Support AdaptiveByteBufAllocator with configurable allocator type and metrics apache/pulsar#26595 / [feat][ml] Configure and track named Pulsar allocators independently apache/pulsar#26597): var / record / instanceof patterns / arrow switch / requireNonNullElse → Java 8 equivalentsPublishPositionSharingBenchmark: Netty 4.2-only currentThreadWillCleanupFastThreadLocals() → static willCleanupFastThreadLocals(Thread.currentThread()) (available in 4.1.137)ManagedLedgerClientFactoryTest add/add conflict resolved keeping both test sets (cache-extension pipeline tests + base checkpoint validation tests)ManagedLedgerFactoryChangeLedgerPathTest port-bind conflict, individually rerun green); on-disk reports 897/897 greenManagedLedgerBkTest (real bookie — first batch-read run on the fork's 4.17 line, incl. testBatchReadNotUsedWithV3WireProtocolClient): 18/18PulsarByteBufAllocatorTypeTest 13/13, PulsarByteBufAllocatorTest 17/17, AllocatorStatsGeneratorTest 4/4ReadEntryUtilsTest 18/18, CompositeLedgerEntriesImplTest 6/6, ManagedLedgerBatchReadTest 4/4install of core modules; distribution tarball spot-checked (4.17.4.1 jar set correct, zero 4.17.4.0/4.18 residue)Not covered by local verification: distribution/shaded/gradle modules (out of porting scope).
Six follow-up fixes from upstream on top of the initial 31 commits:
EntryImpl (stale (-1,-1) position race)conf/pulsar_env.sh + conf/bkenv.sh). Adapted to prepend to PULSAR_EXTRA_OPTS/BOOKIE_EXTRA_OPTS (the 4.0-line conf scripts have no OPTS variable); Netty 4.1.137 natively supports io.netty.allocator.type=adaptive (verified). Not exercised by CI (surefire does not run env scripts) — verified via bash -n, subshell source-expansion assertions, and PulsarByteBufAllocatorTest (named pulsar.allocator.default.type=adaptive coverage)NonDurableCursorTest.subscribeToEarliestPositionWithDeferredDeletion (waits for ledger rollover)managedLedgerContinueCachingAddedEntriesAfterLastActiveCursorLeavesMillis to managed ledgers: before this fix the setting from [improve][broker] Reduce cache retention after reads and apply retention settings at startup apache/pulsar#26627 was written to a factory-level field that nothing read, and the per-ledger value was always 0 ("no active cursors ⇒ stop caching immediately")SendMessageInfo overwritten before the async write listener runs)getTotalAckedIndexCount() read after sendMessages hands batchIndexesAcks to the consumer event loop)Local adaptation notes (folded into the respective picks):
defaultConfig() → rawEntryConfig() (this branch lacks [improve][ml] Allow inline read completion and preserve replication order apache/pulsar#26620's helper); assertj static import added to BrokerServiceTestProducerConsumerBase idioms (BrokerTestUtil.newUniqueName, pulsar.getBrokerService().getTopic(...))SharedDispatcherPermitAccountingTest was not carried over — it depends on SharedPulsarBaseTest ([improve][test] Introduce shared Pulsar cluster for faster integration tests apache/pulsar#25311) and the [fix][broker] Fix persistent throughput degradation caused by permit loss during frequent reconnects on Shared subscriptions apache/pulsar#26289/[fix][test] Avoid unsafe cleanup between shared-cluster tests apache/pulsar#26611/[improve][broker] PIP-379: Remove the classic Shared and Key_Shared dispatcher implementations apache/pulsar#26687 test-harness chain this branch does not have; the main-code fix is complete (log kept in slf4j form, both read points switched to the captured local)Verification (local): managed-ledger full suite 901/901 (897 baseline + 4 new tests); broker subset green (PersistentDispatcherSingleActiveConsumerTest 4/4 incl. the new race test, ManagedLedgerClientFactoryTest 6/6, OpenTelemetryTopicStatsTest 2/2, PersistentMessageExpiryMonitorTest 3/3, AllocatorStatsGeneratorTest 4/4, BrokerServiceTest continue-caching config test); mvn install + checkstyle green for managed-ledger and pulsar-broker.
Four more upstream fixes identified by the post-review omission sweep, ported on top (now 42 commits total):
lastReadCallback single-slot checker only ever timed out the most recent read; replaced by a broker-level ReadEntryTimeoutTracker (MPSC queue + 1s scan). Adaptations: slog → slf4j in the new tracker; the fork's maxSizeBytes read path and its fork-specific third asyncReadEntry overload (plain ReadEntriesCallback) were wired into the new mechanism by intentflowPermitAccountingLock; containsConsumerInstance identity check). Merged to coexist with the fork's ConsumerPrioritySelector ([improve][broker] Optimize consumer selection for shared subscriptions apache/pulsar#26593); all slog contexts desugared to slf4j. The upstream test file SharedDispatcherPermitAccountingTest was not carried over (same constraint as [fix][broker] Fix dispatcher permit accounting race with recycled batch index acks apache/pulsar#26809: depends on SharedPulsarBaseTest / [improve][test] Introduce shared Pulsar cluster for faster integration tests apache/pulsar#25311, which this branch does not have); the main-code fix is complete in both PersistentDispatcherMultipleConsumers and the Classic dispatcherledgerClosedWithReason(..., LedgerRollReason.*) variants; PulsarMockLedgerHandle gained an asyncCloseCount for the new leak assertionsThreadBoundExecutor → ExecutorService mock (4 occurrences)Verification (local): managed-ledger cache package 96/96, ManagedLedgerTest 165 run / 0 failures (160 baseline + 5 new timeout/leak tests), ManagedLedgerErrorsTest 22/22, EntryImplTest 12/12; broker PersistentDispatcherMultipleConsumersTest + Classic + ConsumerTest 10/10, StickyKey dispatcher suites 28/28; full test-compile of managed-ledger / pulsar-broker / testmocks and microbench (-Pmicrobench) green.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… and adding a new cache strategy based on expected read count (apache#24444) (cherry picked from commit cf3d7d1) (cherry picked from commit d5b620d)
…val queue and job (apache#24363) (cherry picked from commit 8ce67b9) (cherry picked from commit 0128390)
…perties stub to the 6-arg internalAsyncMarkDelete The apache#25796 backport (39f0def) landed both the production fix and its test, but the test stubs the 5-arg internalAsyncMarkDelete overload: that is the arity master's asyncMarkDelete chain reaches, while on this branch the chain routes through the 6-arg overload (adding propagatePersistFailure/durableFallback) that NonDurableCursorImpl overrides. The stub therefore never intercepted the advance-path call and the entry latch deterministically timed out, leaving the test red since the backport landed. Stub the 6-arg overload instead; the null-properties contract asserted by apache#25796 is unchanged. (cherry picked from commit b6e2921)
…pache#24623) (cherry picked from commit 490ba0c) (cherry picked from commit f784137)
…er (apache#25988) (cherry picked from commit fbcfacf) (cherry picked from commit 6ea72a9)
…tion (apache#26511) (cherry picked from commit 72632e5) (cherry picked from commit cd9dd80)
…ck since it's already covered by putIfAbsent (apache#24699) (cherry picked from commit 669ab61) (cherry picked from commit dde4580)
…ng the parsed instance in the broker cache (apache#24682) (cherry picked from commit 53bbd4a) (cherry picked from commit 87e7159)
…nd improve caching (apache#24836) (cherry picked from commit 9737d03) (cherry picked from commit 15b4421)
…ntryWrapper (apache#25987) (cherry picked from commit 98bac65) (cherry picked from commit dbbb648)
…ad of under the wrapper write lock (apache#26463) (cherry picked from commit ce60798) (cherry picked from commit feb4935)
…he cache keeps (apache#26495) (cherry picked from commit 9e0f694) (cherry picked from commit 0796516)
…pache#26526) (cherry picked from commit 7bcae18) (cherry picked from commit e34774a)
…ction (apache#26529) (cherry picked from commit a3de5dd) (cherry picked from commit d72a1d1)
…che#26523) (cherry picked from commit 30b975a) (cherry picked from commit 27120c2)
…able the BK batch read API Dependency enablement for apache#25280 (BK batch read): stay on the com.ascentstream fork coordinates and bump bookkeeper.version from 4.17.4.0 to 4.17.4.1. The 4.17.4.1 fork release adds the one BK client API the batch-read port needs (ReadHandle/LedgerHandle batchReadUnconfirmedAsync(long, int, long)); all other batch-read and builder entry points already exist in 4.17.4.0. Netty stays at 4.1.137.Final, the client bytecode release stays at 8, and no coordinate switch is involved. Unlike the dev/pick_batchread_and_cache variant (BK 4.18.1 + netty 4.2.18), this branch keeps the fork line, so the change is limited to the version property and the jar version strings in the two distribution LICENSE files; the 4.17.4.1 jar set is identical to 4.17.4.0 (server adds one inner class, distributedlog-core is class-for-class identical, the allocator still logs through slf4j, so the java-instance.jar slog bundling is not needed here).
…ator type and metrics (apache#26595) (cherry picked from commit e1a1581) (cherry picked from commit b271678)
apache#26593) (cherry picked from commit e7cbb33) (cherry picked from commit c9f5b7f)
…pache#26597) (cherry picked from commit ca58c20) (cherry picked from commit d96a0c3)
Co-authored-by: Lari Hotari <[email protected]> Co-authored-by: Matteo Merli <[email protected]> (cherry picked from commit f369915) (cherry picked from commit bc48257)
…apache#26603) (cherry picked from commit 0677be2) (cherry picked from commit 4f184f2)
apache#26604) (cherry picked from commit 14e0ede) (cherry picked from commit cd27e27)
…ion settings at startup (apache#26627) (cherry picked from commit bed06a0) (cherry picked from commit d88d711)
…pache#26628) (cherry picked from commit 3efae19) (cherry picked from commit 63cd52b)
…pId com.ascentstream
The fork renamed the maven groupId from org.apache.pulsar to
com.ascentstream.pulsar, but the CI infrastructure still referenced the
upstream path ~/.m2/repository/org/apache/pulsar:
- the actions/cache exclusion lists kept caching com.ascentstream
SNAPSHOT reactor artifacts under a key derived only from
hashFiles('**/pom.xml'), so java-only fixes never changed the key and
unit jobs kept testing whatever jars were cached when the key was
first saved (observed: the netty-4.2 TLS builder fix and the
PulsarMockBookKeeper properties fix were amended into the branch
without touching any pom; CI restored a pre-fix cache entry and the
already-fixed AuthenticationTlsHostnameVerificationTest[false],
SchemaTest.testConcurrentCreateSchemaNoOrphanLedger and
ProxyServiceTlsStarterTest.testProducer kept failing with the exact
pre-fix signatures while every local configuration was green);
- the pulsar-maven-repository-binaries tar packed (and therefore the
unit jobs' restore delivered) zero fork artifacts, so the fresh build
could never override the stale cache;
- the coverage/deps tooling (snapshot_pulsar_maven_artifacts, classpath
greps, sourcefiles extraction) silently matched nothing.
Point all of these at com/ascentstream so snapshot reactor artifacts are
never served from the shared cache and unit jobs always consume the
fresh build results, matching the upstream design under the fork's
groupId.
(cherry picked from commit e85c4c0)
…r the fork groupId The previous org/apache/pulsar -> com/ascentstream path fix missed one path segment here: the fork's groupId com.ascentstream.pulsar resolves artifacts under ~/.m2/repository/com/ascentstream/pulsar/<artifactId>/..., so the perl expression captured the constant segment 'pulsar' instead of the artifactId. Every jar then greps multiple lines of the project mapping and the coverage --sourcefiles arguments are dropped. Anchor the pattern one segment deeper, matching the tar exclusion fixed in the same commit. (cherry picked from commit 195068a)
…tryImpl (apache#26707) (cherry picked from commit b27d3ad)
…llocator (apache#26720) (cherry picked from commit d649aac)
…nWithDeferredDeletion (apache#26747) (cherry picked from commit 1e67dd6)
…ActiveCursorLeavesMillis to managed ledgers (apache#26785) (cherry picked from commit 2aee226)
…nts from another dispatch (apache#26810) (cherry picked from commit 33dca0e)
…ch index acks (apache#26809) (cherry picked from commit 1046481)
Surgical backport of the MockedPulsarServiceBaseTest change from apache#25680: deleteNamespaceWithRetry relied on Awaitility's default 10-second timeout, so a starved-out cleanup cascaded into dozens of 'admin is null' failures under CI load (e.g. TopicEventsListenerTest 24-failure cascades). The BacklogQuotaManagerTest portion of apache#25680 is not carried over: this branch already has the richer createNamespaceForTest handling from apache#26313. (cherry picked from commit 02d12a6) Partial pick: only the MockedPulsarServiceBaseTest line.
(cherry picked from commit 9ba61bd)
…loss during frequent reconnects on Shared subscriptions (apache#26289) (cherry picked from commit 12b6497)
…try IDs (apache#26821) (cherry picked from commit 2b6becb)
a8d48e6 to
312c069
Compare
…ged-ledger pom The duplicate declaration (present on the base since the checkpoint persistence commits) is fatal under Maven 4's strict model validation, which the ubuntu-24.04 CI runners now use: the build fails at POM parsing in the Build and License check and Flaky tests suite jobs.
… compatibility The ubuntu-24.04 CI runners now ship Maven 4, under which the 2.2 extension crashes at afterProjectsRead with a Guice injection error (pluginDescriptorCache binding). 2.4.2 loads cleanly under Maven 4.0.0-rc-7 (verified locally with the CI's license-check step).
The ubuntu-24.04 CI runners now ship Maven 4, under which the Develocity Maven extension crashes at afterProjectsRead with a Guice injection error (pluginDescriptorCache binding); the failure persists even on the latest 2.4.2 release, so the runner's Maven 4 build is incompatible with the extension line as a whole. The extension only publishes build scans to develocity.apache.org (Apache's instance) and is unused on this fork (no access key), so removing it is the deterministic fix. The orphaned develocity.xml and custom-user-data groovy config are inert without the extension. Verified locally: 'mvn initialize' passes on both Maven 4.0.0-rc-7 and Maven 3.9.12 without the extension.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.