837 Commits
Author SHA1 Message Date
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
imzs b764205990 [ISSUE #11272] Defer LMQ arrival notification to post-commit (#11273) 2026-10-12 13:36:26 +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
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
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
rongtong ec0f662c54 [ISSUE #10383] Fix flaky store and proxy tests (#10407)
* Fix flaky store HA and DLedger tests

* Fix receipt handle renewal test race
2026-09-02 09:28:29 +08:00
rongtong df8194146e [ISSUE #10641] Deprecate legacy Broker DLedger mode (#10642) 2026-08-19 17:42:51 +08:00
ymwneuandmaowei.ymw e58f9fd35a [ISSUE #10959] Fix RocksDBConsumeQueue.iterateFrom should reject offset below min offset (#10960)
startIndex < minOffset was previously accepted as long as it stayed
within [0, maxOffset), returning a non-null LargeRocksDBConsumeQueueIterator
whose next() can yield a null CqUnit once the underlying data has been
purged. Callers like ScheduleMessageService rely on iterateFrom returning
null to detect and correct an out-of-range offset (matching ConsumeQueue's
getMinLogicOffset() check); without it they NPE dereferencing the null
CqUnit instead.

Add the same startIndex >= getMinOffsetInQueue() bound used by the
file-based ConsumeQueue to both iterateFrom overloads.

Co-authored-by: maowei.ymw <maowei.ymw@alibaba-inc.com>
2026-08-19 10:56:51 +08:00
qianye cf27650066 [ISSUE #10953] Clamp shifted message count range to queue bounds (#10954) 2026-08-18 12:02:27 +08:00
fuyou001 51f9fcc493 [ISSUE #10817] Upgrade SpotBugs for JDK 21 compatibility (#10818) 2026-08-06 19:22:52 +08:00
Rui cf2b874581 [ISSUE #10813] Reduce temporary allocations in the LMQ append path (#10814)
Signed-off-by: Rui <1685901819@qq.com>
2026-08-06 17:14:37 +08:00
fuyou001 cbebac2e66 [ISSUE #10819] Correct misleading CommitLog buffer comment (#10820)
* [ISSUE #10819] Correct misleading CommitLog buffer comment

* [ISSUE #10819] Refine CommitLog comment wording
2026-08-06 16:33:59 +08:00
ymwneu 89166af997 [ISSUE #9654] Optimize the bufferLocal size of the TimerMessageStore (#9655) 2026-08-03 11:24:22 +08:00
Jiahua Wangandwangjiahua.wjh b37e2bbacd [ISSUE #10639] Reuse a per-thread scratch buffer in CommitLog.checkMessageAndReturnSize (#10640)
* [ISSUE #10639] Reuse a per-thread scratch buffer in CommitLog.checkMessageAndReturnSize

* [ISSUE #10639] Reject corrupt negative totalSize before allocation in checkMessageAndReturnSize

* [ISSUE #10639] Add configurable reuse-buffer cap and unit tests for checkMessageAndReturnSize

* [ISSUE #10639] Default the check-message reuse-buffer cap to 1 MiB

---------

Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
2026-07-23 23:55:33 +08:00
imzs 45254d5e13 [ISSUE #10615] Fix missing long-polling notification under CombineConsumeQueue selective double-write (#10616) 2026-07-14 13:39:34 +08:00
SSpirits 88709c56aa [ISSUE #10543] resolve data race in ServiceThread wakeup mechanism (#10544) 2026-06-30 10:26:23 +08:00
chenxu80 2e6632ff40 [ISSUE #10417] Fix stale minOffset after consumeQueue truncation (#10418) 2026-06-23 17:10:16 +08:00
rongtong b5bc1ff5d6 Fix flaky HATest semi-sync replication (#10495) 2026-06-21 09:37:25 +08:00
echooymxq bfbbb2a955 [#10421] Fix Timer message rocksdb use wrong cache key. (#10422) 2026-06-20 10:44:49 +08:00
lizhimins f941dced39 [ISSUE #10521] Use madvise(MADV_RANDOM) to disable kernel read-ahead during correctMinOffset binary search (#10523) 2026-06-17 19:43:16 +08:00
imzs 1ab9689f34 [ISSUE #10450] Selective double-write in CombineConsumeQueueStore (#10452) 2026-06-11 21:14:18 +08:00
imzs 8a589c6a53 [ISSUE #10453] Fix unexpected decrement of lmq counter (#10454) 2026-06-11 21:11:08 +08:00
rongtong a6fb9e2fa0 [ISSUE #10410] Fix RocksDBOptionsFactoryTest compile failure (#10411) 2026-06-01 20:42:10 +08:00
rongtong e12d755a77 [ISSUE #10344] Parameterize RocksDB CQ size amplification 2026-06-01 10:47:24 +08:00
lizhimins 9443c6d9db [ISSUE #10383] Align Bazel dependencies with Maven pom.xml (#10404) 2026-05-29 10:04:20 +08:00
Quan 9e2d877055 [ISSUE #10375] Fix race condition between deleteTopic and FlushConsumeQueueService by removing getLifeCycle indirection (#10376) 2026-05-25 23:13:40 +08:00
lizhimins 7e5d22dff8 [ISSUE #10334] Make native CqCompactionFilter shim self-contained without rocksdbjni dependency (#10371) 2026-05-25 10:07:16 +08:00
lizhimins 61c493c068 [ISSUE #10334] Support native CqCompactionFilter with cross-platform JNI shim (#10335) 2026-05-21 10:12:14 +08:00
lizhiminsandClaude Opus 4.7 0752ddf89b [ISSUE #10270] Make Pop RocksDB BlockCache size configurable via MessageStoreConfig (#10271)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 17:24:38 +08:00
imzs 343daa9fb5 [ISSUE #10173] Improve PopLite: rename RocksDB CQ path and schedule autoClean (#10242) 2026-04-07 17:51:59 +08:00
imzs 2c2cc921ba [ISSUE #10173] Support LMQ in CombineConsumeQueueStore without migration to RocksDB CQ (#10174) 2026-04-03 14:29:42 +08:00
hqbfz d66cfa9d7a [ISSUE #10165] Prevent RocksDB metrics from being overwritten after timer engine switch (#10166) 2026-03-30 16:48:33 +08:00
lizhimins e5d33722d9 [ISSUE #10223] Not query the index of system topics in tiered storage (#10224) 2026-03-30 13:34:53 +08:00
yx9o 932588d3e1 [ISSUE #10201] Optimize queryOffset method overloads in IndexService (#10202) 2026-03-25 15:24:21 +08:00
yx9o ebf1595418 [ISSUE #10103] Improve batch polling efficiency in pollIndexRecord method (#10104) 2026-03-17 16:22:28 +08:00
rongtongandRongtongJin 628230d22c [ISSUE #10011] Optimize accelerated recovery process and refactor code (#10012)
* When IndexRocksDBEnable or TransRocksDBEnable are enabled, we need to take these two offsets into account to accelerate recovery.

* Add UTs

* Refactor the code based on the review comments

* Revert "[ISSUE #8127]Optimize the metric calculation logic of the time wheel"

* Remove useless import

* Refactor Code

* Refactor Code

* Refactor Code

* Refactor Code

* Refactor Code

* Implement accelerated recovery for the file-based ConsumeQueue.

* Implement accelerated recovery for the file-based ConsumeQueue.

Change-Id: Ieac45d0582f2f83d977aeb8e6f5084268b7f8752

* Implement accelerated recovery for the file-based ConsumeQueue.

* Ignore testTruncateCQ UT

---------

Co-authored-by: RongtongJin <user@example.com>
2026-02-28 10:30:15 +08:00
yuz10 7be720250e [ISSUE #10108] Broker startup fail in recover (#10109) 2026-02-24 13:56:23 +08:00
yx9o b8f8856868 [ISSUE #10105] Fix ClassCastException in getLocks() method (#10106) 2026-02-23 14:43:45 +08:00
guyinyouandguyinyou c197e50f8d [ISSUE #10079] FlushConsumeQueueService: always flush store checkpoint after CQ flush (#10080)
Change-Id: I57c0922bb81c2d43359867e82a92fdf2deab7ad7

Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>
2026-02-09 17:38:03 +08:00
gaoyf 1754cece4b Restore the lost PR 3460 (#10067) 2026-02-06 15:30:15 +08:00
guyinyouandguyinyou 26480ddc87 [ISSUE #10073] Fix StoreCheckpoint logicsMsgTimestamp to reflect flushed consume queue storetime (#10074)
* Fix StoreCheckpoint: set logicsMsgTimestamp only after CQ flush, use logicsMsgTempTimestamp for in-memory storetime

Change-Id: I6085bf6efaef84168ece31d080481717465f2b13

* rename to tmpLogicsMsgTimestamp

Change-Id: Ia65ca06751f765bdc2bf053c58e08789f4b2fb22

---------

Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>
2026-02-05 22:34:12 +08:00
lizhimins 10c650c487 [ISSUE #10034] Optimizing cq iterator and calculating lag (#10056) 2026-02-02 21:01:46 +08:00
ltamber f80753f0da [ISSUE #10050] Support ChangeInvisibleTime without incrementing message reconsume times (#10051) 2026-02-02 14:06:57 +08:00
rongtongandRongtongJin 7583fda113 fix(store): close all consume queue file handles on ConsumeQueueStore shutdown (#10060)
* fix(store): close all consume queue file handles on ConsumeQueueStore shutdown

* remove implementation

---------

Co-authored-by: RongtongJin <user@example.com>
2026-02-02 11:41:35 +08:00
wizcraft_kris 24ca9e46b5 [ISSUE #10043] Make TimerMessageReputService thread pool configurable and shutdown gracefully (#10044) 2026-01-30 10:04:40 +08:00
guyinyouandguyinyou c7892a694a [ISSUE #9852] Print full message when CRC not found in properties (#9853)
When the error 'failed to check message CRC, not found CRC in properties' occurs,
now it will print the full message content including topic, properties map,
properties length, and full message hex for debugging purposes.

Change-Id: I26d977e13802c5e69d01f16512e40d121dcff354
Co-developed-by: Cursor <noreply@cursor.com>

Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>
2026-01-26 10:02:17 +08:00
guyinyouandguyinyou 90b0906ae6 [ISSUE #10038] Fix checkCommitLogOffsetOnRecover to skip validation for BLANK_MAGIC_CODE messages (#10039)
Change-Id: If1913db5155fe4135f2dbd1b58417b3afc6748c1

Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>
2026-01-26 10:01:49 +08:00
guyinyouandguyinyou 236ede218a Fix: avoid extra padding when message end position is already page-aligned (#10036)
Change-Id: I3e7fad9c4b194b20015414bcceb830760df68fea

Co-authored-by: guyinyou <guyinyou.gyy@alibaba-inc.com>
2026-01-21 17:19:34 +08:00