Repository navigation
[ISSUE #11498] Skip timer log scan in checkAndReviseMetrics when no eligible timer slot exists - #11499
[ISSUE #11498] Skip timer log scan in checkAndReviseMetrics when no eligible timer slot exists#11499Ajax-1 wants to merge 1 commit into
Conversation
…n no eligible timer slot exists TimerWheel.checkPhyPos returns Long.MAX_VALUE when no slot matches, which was passed directly to TimerLog.getWholeBuffer and produced a misleading "Offset not matched" warning. Skip the scan for the sentinel while keeping the metrics revision.
27923b3 to
fe2896a
Compare
|
Hi, a note for reviewers: #11498 was closed by the reporter, but as far as I can tell the issue is still present on |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11499 +/- ##
=============================================
- Coverage 49.89% 49.83% -0.06%
+ Complexity 14432 14411 -21
=============================================
Files 1391 1391
Lines 103362 103363 +1
Branches 13519 13520 +1
=============================================
- Hits 51572 51515 -57
- Misses 45596 45634 +38
- Partials 6194 6214 +20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the review! The only failing check is |
Which Issue(s) This PR Fixes
Brief Description
TimerWheel.checkPhyPos(readTimeMs, 0)returnsLong.MAX_VALUEwhen no eligible slot exists in the timer wheel.TimerMessageStore.checkAndReviseMetrics()passed that sentinel straight totimerLog.getWholeBuffer(...), soMappedFileQueue.findMappedFileByOffsetlogged a misleadingOffset not matched. Request offset: 9223372036854775807 ...warning whenever a TimerLog mapped file existed.This PR makes the scan loop skip the sentinel (
while (currOffsetPy != Long.MAX_VALUE)) instead of returning early, so the subsequent metrics revision still runs and small-topic counts are still reconciled (e.g. revised to 0 when the wheel is empty). Behavior for valid offsets is unchanged.How Did You Test This Change?
Added two tests in
TimerMessageStoreTest:testCheckAndReviseMetricsWithEmptyTimerWheel: TimerLog has an allocated mapped file and the wheel has no eligible slot; verifiesgetWholeBuffer(Long.MAX_VALUE)is never called and a stale metric (5) is revised to 0. This test fails without the fix.testCheckAndReviseMetricsWithValidSlot: enqueues two timer records into a valid slot; verifies the scan still works and a stale metric (5) is revised to 2.Ran
mvn -pl store test -Dtest='TimerMessageStoreTest,TimerWheelTest,TimerMetricsTest'locally: all passed (one pre-existing test is skipped on macOS byAssume), checkstyle passed.