9245 Commits
Author SHA1 Message Date
Felix-Gong 8ab8191478 [ISSUE #11481] fix(broker): do not abort the queue-mapping clean pass on a missing remote queue (#11482)
cleanItemListMoreThanSecondGen() validates, for every queue whose leader
moved, that the new leader agrees. It reads the new leader's hosted
queues with get(qId) and calls isEmpty() on the result unconditionally:
when the remote broker's mapping does not contain that queue id at all —
the transient state this service exists to reconcile — the read returns
null and the pass dies with a NullPointerException.

The exception is swallowed by the per-topic catch, so the visible damage
is silent: every remaining queue of that topic is skipped for this cycle,
the mapping is left half-cleaned, and the failure repeats every five
minutes.

Treat a missing remote queue as "not confirmed yet" and continue, which
is how the surrounding reads already handle absent data.

Red/green: remoteLeaderMissingTheQueueIdDoesNotAbortTheRestOfTheTopic
fails on the old code (the second queue is never removed because the NPE
aborts the pass) and passes with the null guard. Broker module: 815
tests, the 7 failures are pre-existing (RocksDB/filter/schedule/pop-lite/
BrokerOuterAPI) and reproduce identically with this change stashed.
2026-10-23 10:14:32 +08:00
bai mengxuan 38a7ca0d23 [ISSUE #11477] fix(container): stop the container scheduler when the broker container shuts down
BrokerContainer.initialize() schedules the name-server refresh and the five-second
brokerOuterAPI.refreshMetadata() task on scheduledExecutorService, and shutdown()
stops the brokers, both remoting servers, the request executor and the outer API -
but not that scheduler. A shut-down container therefore keeps refreshing metadata
through an API it has already closed, logging "ScheduledTask refresh metadata
exception" every five seconds, and leaks the scheduler thread on every start/shutdown
cycle. Stop it before the API is closed, the way the request executor next to it is
stopped.
2026-10-22 17:22:47 +08:00
zhang hongyuan 391f8ab009 feat: add mqadmin getTopicConfig command (#11473)
Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
2026-10-22 17:22:17 +08:00
bai mengxuan 57c2dc04f7 [ISSUE #11427] fix(client): stop the pop consume service when the push consumer shuts down (#11428) 2026-10-20 09:19:19 +08:00
bai mengxuan f3386107cb [ISSUE #11452] fix(common): name the file in the checkpoint crc mismatch message
CheckpointFile.read builds the IOException for a crc32 mismatch with a "file=%s"
label but passes expectedCrc32 into it, so an operator who opens a corrupted
checkpoint reads e.g. "file=823222925" - a checksum where the path that failed to
load is expected - and the expected value itself is never named.

Pass the path that was read and label the expected checksum, and pin it with the
case that corrupts both the checkpoint and the .bak fallback read() falls back to.
2026-10-19 17:43:43 +08:00
bai mengxuan 5d68880cbd [ISSUE #11412] fix(store): report an empty batch consume queue as empty instead of throwing (#11417) 2026-10-16 14:12:40 +08:00
Adrian Wang 140e3d5763 [ISSUE #11398] Correct consumeMessage end timestamp option in documentation 2026-10-15 16:06:09 +08:00
Adrian Wang 0e480153cc [ISSUE #11415] Fix message count accounting in mqadmin consumeMessage 2026-10-15 10:47:16 +08:00
Adrian Wang 39a0c76798 fix: preserve message body whitespace in mqadmin sendMessage (#11414) 2026-10-15 10:26:16 +08:00
Untergang1 0dd48c39db [ISSUE #11402] Add unit tests for TopicSysFlag and SubscriptionSysFlag (#11404) 2026-10-14 17:29:47 +08:00
leaveWhite9088 dc70260b7b [ISSUE #11392] Ignore AI agent default files in .gitignore (#11395)
* [ISSUE #11392] Ignore AI agent default files

Add common AI coding assistant configuration files (.claude/, CLAUDE.md,
.cursor/, .cursorrules, .windsurf/, .windsurfrules, .aider*, .continue/,
.codeium/, .gemini/, GEMINI.md, AGENTS.md) to .gitignore so contributors
do not accidentally commit local AI agent artifacts.

* Also ignore .qoder/ default config files

Covers the same rule proposed in #11391, making this PR a superset and
avoiding a merge conflict on .gitignore between the two PRs.

* Also ignore Qoder, Cline, Roo Code, Augment, Amazon Q, Trae, Junie, Cody and Copilot default files
2026-10-14 14:42:31 +08:00
majialong a7edeecfb6 [ISSUE #11223] Fix stale lag time info remaining in getLiteGroupInfo after lite topic expired (#11224) 2026-10-13 09:22:28 +08:00
imzs b764205990 [ISSUE #11272] Defer LMQ arrival notification to post-commit (#11273) 2026-10-12 13:36:26 +08:00
Quan e1eb99c852 [ISSUE #11203] Fix incorrect consumption mode reported for wildcard Lite groups (#11204)
Wildcard Lite consumer groups consume with clustering semantics, but the
registration path reported them as LITE_SELECTIVE, so the admin/console view
showed an incorrect consumption mode.

Instead of adding a new MessageModel value, derive the Lite identity from the
client type carried on ProxyContext and normalize the reported model:

- ClientActivity#registerConsumer writes the real client type into the context
  via ctx.setClientType, so downstream no longer infers Lite identity from the
  display-only LITE_SELECTIVE value.
- ClientProcessor replaces validateLiteMode with validateLiteConsumer, which
  reads ctx.isLiteConsumer() plus the real (remapped) SubscriptionGroupConfig to
  enforce that Lite clients only register to Lite groups and vice versa, and
  normalizes a wildcard Lite group's model to CLUSTERING before registration.

The overridden method signatures kept by the commercial subclass
(registerConsumer, validateLiteSubTopic) are unchanged.
2026-10-12 11:07:25 +08:00
Xiao Yang 9ea2ccdc2b [ISSUE #11230] Fix self-eviction on repeated exclusive LiteTopic subscription (#11231) 2026-10-08 17:24:04 +08:00
zhang hongyuan 5a6e349739 [ISSUE #11306] fix(tools): compare long counters without truncating to int (#11274)
GroupConsumeInfo.compareTo, TagCountBean.compareTo and
QueryMsgByUniqueKeySubCommand.queryById subtracted two long values and cast
the difference to int, so a difference beyond Integer.MAX_VALUE reversed the
order and broke the comparator contract that TimSort checks. Use
Long.compare / Comparator.comparingLong instead.

Signed-off-by: zhang hongyuan <100520587+Metastarx@users.noreply.github.com>
2026-10-08 14:46:23 +08:00
健康宝andClaude Opus 5 bb996b4a50 [ISSUE #11283] fix(remoting): RpcClientUtils.encodeBody must not clobber the caller's ByteBuffer mark (#11296)
encodeBody used mark()/get()/reset() on the caller's buffer, which
restored the position but silently overwrote any mark the caller had set,
so a later reset() jumped to the wrong position. Read the remaining bytes
from a duplicate() instead, leaving the original buffer's position, limit
and mark untouched, and add a regression test.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-08 10:46:11 +08:00
Quan a4b659b817 [ISSUE #11250] Fix Lite topic ack re-dispatching the event while holding the pop lock (#11251)
* [ISSUE #11250] Fix Lite topic ack re-dispatching the event while holding the pop lock

- Decide the re-dispatch under the pop lock and dispatch after releasing it
- Add a unit test asserting the pop lock is free when the ack dispatches

* [ISSUE #11250] Re-trigger CI
2026-10-08 09:54:09 +08:00
Quan bef2f4810c [ISSUE #11248] Fix Lite topic consumer losing messages when notified before they are readable (#11249)
* [ISSUE #11248] Fix Lite topic consumer losing messages when notified before they are readable

- Mark a lite topic in the per-request dedup set only after messages are read
- Retry a re-dispatch within the same pop after an empty read instead of dropping it
- Add unit tests for the empty-read path of popLiteTopic and popByClientId

* [ISSUE #11248] Re-trigger CI
2026-10-08 09:53:49 +08:00
Rui Yin 37af1437e6 [ISSUE #10478] Support Lite messages in proxy local mode (#11053)
* [ISSUE #10478] Support Lite messages in proxy local mode

* [ISSUE #10478] Cover Lite pop edge cases and log invalid metadata
2026-10-03 15:27:10 +08:00
beautyarbutin 78b96bc5e2 [ISSUE #10853] fix(store): validate HA state ordinals (#11200)
* [ISSUE #10853] fix(store): validate HA state ordinals

* test(store): cover valid HA state ordinals
2026-09-23 14:42:31 +08:00
fb1b30cbd2 [ISSUE #11156]fix(timer): persist TimelineRollService checkpoint to avoid repeated and loss (#11157)
* fix(timer): persist TimelineRollService checkpoint to avoid repeated rolls

Scan hour-sized windows from a RocksDB checkpoint instead of sleeping a fixed interval, so delayed scans do not skip or re-roll the same timer messages.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Persist the roll checkpoint only after the messages are reput

TimelineRollService used to write the checkpoint right after a scan, so a crash
between the scan and the reput dropped the whole window. The reput service now
owns the write and takes the key to write, which lets the roll queue persist its
own checkpoint the same way the expired queue already does. Roll keeps its scan
frontier in memory and advances it per window, as TimelineForwardService does.

Without a persisted roll checkpoint the frontier is derived from the delivery
checkpoint plus one maximum delay, so a broker that ran without this key
re-scans its windows instead of skipping them.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop timerRocksDBRollIntervalHours and back off on roll errors

A checkpoint driven loop advances one window per window width, so the width and
the cadence are the same quantity and only one config can define it. Keep
timerRocksDBRollRangeHours as the scan window width and remove
timerRocksDBRollIntervalHours, which no longer has a role of its own.

The outer catch used to log and retry immediately, spinning the thread while
rocksdb keeps throwing.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix

* Retrigger CI

Co-authored-by: Cursor <cursoragent@cursor.com>

* Honor timerEnableRetryUntilSuccess in the RocksDB timer reput path

Reuse the file-wheel flag so a recoverable put keeps retrying instead of
advancing the roll checkpoint after a fixed number of failures.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Retrigger CI

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: hqbfzwang <hqbfzwang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 11:43:11 +08:00
Quan 6291ce1ed3 [ISSUE #11191] Fix Lite topic consumer losing messages on event re-dispatch during a pop (#11192)
- Mark the dedup entry only after a lite topic is handled under the pop lock, not when it is FIFO-blocked, so a re-dispatched event is retried instead of dropped
- Move the processed-set marking into popLiteTopic and narrow its visibility
- Add a regression test reproducing the concurrent ack-unblock event loss
2026-09-22 11:07:00 +08:00
qianye 8227ecd1ac [ISSUE #11170] Preserve transaction subscriptions before first heartbeat (#11171) 2026-09-21 16:01:43 +08:00
majialong 89d51387bf [ISSUE #11176] Fix incorrect filter appender name in broker logging configuration (#11177) 2026-09-21 10:15:18 +08:00
lizhimins 050d2b42b0 [ISSUE #11168] Fix tiered storage commit failure reporting and related hazards (#11169) 2026-09-20 11:35:07 +08:00
rongtongandRongtongJin 42a6d576ab Remove synchronized from deleteTopic. (#9997)
Co-authored-by: RongtongJin <user@example.com>
2026-09-17 18:34:49 +08:00
imzs bc33e8e4d7 [ISSUE #11078] Support suppressing minimal-value metrics to reduce export payload (#11079) 2026-09-16 14:17:26 +08:00
Quan 80e1ae5577 [ISSUE #11163] Fix lite topic prefix index not maintained on first message (#11164)
- Correct the off-by-one offset check in LiteEventDispatcher.dispatch (offset == 0 -> == 1) so onLmqCreate fires on the first arriving message
- Restore store-dependent lifecycle tests to the concrete impl test classes, driven by real putMessage through the notify path
- Add MessageArrivingListener overloads to LiteTestUtil to wire the real dispatch path in tests
2026-09-15 10:03:56 +08:00
Jiahua Wangandwangjiahua.wjh 4dad755fdc [ISSUE #10980] Encode and decode POP checkpoint and ack messages without the intermediate JSON string (#10981)
Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
2026-09-15 08:42:36 +08:00
qianye 923a80e9f4 [ISSUE #11161] Fix closeChannel table eviction and ChannelWrapper.close lock ordering (#11162) 2026-09-14 17:19:37 +08:00
Xiao Yang 290d440e7d [ISSUE #11087] Validate lite.bind.topic for LiteTopic groups (#11088)
* [ISSUE #11087] Validate lite.bind.topic for LiteTopic groups

* Update
2026-09-14 10:23:13 +08:00
shown e38f72c788 [ISSUE #10877] fix(filter): convert boolean string operands safely 2026-09-13 08:58:16 +08:00
Quan 1a50c6e4e3 [ISSUE #11129] Fix HashedWheelTimer leak of Lite pop on broker shutdown (#11130)
- Shutdown the Lite pop processor's ConsumerOrderInfoManager in BrokerController shutdown flow
2026-09-11 15:57:57 +08:00
zhaohaiandlizhimins d38f81e787 [ISSUE #10825] feat(proxy): Implement the Proxy Admin gRPC management interface (#10826)
Implement the control-plane admin capability as a gRPC service
served from the proxy process (NOT connecting to broker remoting/grpc
directly), per the rocketmq-apis admin.proto contract.
---------
Co-authored-by: lizhimins <707364882@qq.com>
2026-09-11 11:43:49 +08:00
qianye 8045955432 [ISSUE #11089] Share consumption executors for Proxy internal clients (#11090) 2026-09-11 10:18:26 +08:00
qianye df5b53d0e5 [ISSUE #11080] Skip unused remoting client event executor (#11081) 2026-09-10 13:57:15 +08:00
qianye eedd7607de [ISSUE #11083] Release owned gRPC event loops and stabilize POP priority tests (#11084) 2026-09-10 13:45:34 +08:00
qianye aea87c4e42 [ISSUE #11091] Fix remoting sub-server timeout scanning and scheduler shutdown (#11092) 2026-09-10 13:44:33 +08:00
qianye 4fd0e3beea [ISSUE #11085] Stabilize offset reset tests and guard POP revive cache logging (#11086) 2026-09-09 15:15:39 +08:00
dingshuangxi888andshuangxi.dsx 37808b38c1 fix(auth): tolerate blank subscription topics in heartbeats (#11082)
* fix(auth): tolerate empty topics in consumer heartbeats

* fix(auth): skip blank heartbeat subscription topics

---------

Co-authored-by: shuangxi.dsx <shuangxi.dsx@alibaba-inc.com>
2026-09-09 10:26:04 +08:00
qianye 93c6d96f90 [ISSUE #11072] Reject route queries when NameServer shuts down (#11073) 2026-09-09 09:57:33 +08:00
ymwneu fd2dc2ffc2 [ISSUE #11000] Extract user-property validation in SendMessageActivity#buildMessageProperty into an overridable checkUserProperties method (#11001)
Extract the user property validation logic (property count limit,
reserved-key check, control character check) from buildMessageProperty()
into a standalone protected checkUserProperties() method. The property
size accumulation stays in buildMessageProperty().
2026-09-08 15:39:58 +08:00
Quan 1e29112853 [ISSUE #10929] Add LmqPrefixIndex to accelerate wildcard dispatch and refine lite subscription model (#10930)
* [ISSUE #10929] Add LmqPrefixIndex to accelerate wildcard dispatch and refine lite subscription model

- Add LmqPrefixIndex, a prefix-ordered in-memory index over lmq names, bootstrapped at startup and maintained via onLmqCreate/onLmqDelete hooks
- Rewrite wildcard full dispatch, getLiteTopicCount, collectByParentTopic and cleanByParentTopic on index-backed forEachLiteTopicByPrefix/ByParent, turning O(total lmqs) scans into O(matched lmqs)
- Refine lite subscription model: replace SubscriberWrapper with Map-based getAllSubscribers, simplify getWildcardGroupClients, rename getLiteTopicSet to getLmqSet, make LiteCtlListener callbacks default methods

* [ISSUE #10929] Retrigger CI
2026-09-08 15:38:33 +08:00
dingshuangxi888andshuangxi.dsx 66362b9c9f fix(auth): address ACL follow-up regressions (#11009)
Co-authored-by: shuangxi.dsx <shuangxi.dsx@alibaba-inc.com>
2026-09-08 09:42:40 +08:00
706142718f [ISSUE #9916] Remove getTimerCheckpoint() from BrokerController (#9905)
* refactor: remove getTimerCheckpoint() from BrokerController

* Update SlaveSynchronizeTest.java

fix UnnecessaryStubbing

---------

Co-authored-by: RongtongJin <user@example.com>
Co-authored-by: sun <lwclover@126.com>
2026-09-07 17:33:09 +08:00
lizhimins ff8f6f74c5 [ISSUE #11011] Fix misplaced license header in ConfigManagerTest (#11012)
Move the ASF license comment to the top of the file, before the
package statement. It was squeezed onto the same line as the package
declaration (introduced by b6ff649291), which breaks the conventional
header placement used across the codebase.
2026-09-04 15:17:02 +08:00
lizhimins d442063fe0 [ISSUE #11007] Fix flaky CreateAndUpdateTopicIT by awaiting route propagation (#11008)
Wrap the topic route-size assertions in awaitility polling so the tests
wait for broker->NameServer route propagation instead of asserting
immediately. This removes the race condition that intermittently caused
'Expected size: 3 but was: 2' failures in the CI pipeline.

Applied to testCreateOrUpdateTopic_EnableSingleTopicRegistration,
testStaticTopicNotAffected and testCreateOrUpdateTopic_EnableSplitRegistration,
consistent with the existing awaitility pattern in the same class.
2026-09-04 10:27:05 +08:00
Jiahua Wangandwangjiahua.wjh 88846a0a5b [ISSUE #10288] Hold MappedFile reference in ConsumeQueue write path to prevent SIGSEGV (#10566)
ConsumeQueue.putMessagePositionInfo() accesses MappedFile without
holding a reference count. A concurrent cleanExpiredConsumeQueue
can destroy() the MappedFile (unmapping its buffer) while the
writer is still using it, causing SIGSEGV in JIT-compiled
Unsafe.copyMemory.

Fix: Call mappedFile.hold() before accessing the buffer and
release() in a finally block, following the same pattern used
in DefaultMappedFile.getData(). Also protect the fillPreBlank
call in initializeWithOffset.

Reported crash signatures:
- Case 1 (v4.9.4): SEGV_MAPERR in ReputMessageService thread
  at ConsumeQueue.putMessagePositionInfo
- Case 2 (v5.3.3): SEGV in AdminBrokerThread at
  ConsumeQueueStore.cleanExpired

Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
2026-09-03 15:55:22 +08:00
Jiahua Wangandwangjiahua.wjh e533b663fb [ISSUE #10972] Encode timer message propertiesString after internal properties are cleared (#10974)
Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
2026-09-03 15:54:43 +08:00