Repository navigation
[ISSUE #11498] Skip timer log scan in checkAndReviseMetrics when no eligible timer slot exists - #11499
Open
Ajax-1 wants to merge 1 commit into
Open
[ISSUE #11498] Skip timer log scan in checkAndReviseMetrics when no eligible timer slot exists#11499Ajax-1 wants to merge 1 commit into
Ajax-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.
Ajax-1
force-pushed
the
fix/issue-11498-timer-metrics-sentinel
branch
from
October 28, 2026 16:15
27923b3 to
fe2896a
Compare
Author
|
Hi, a note for reviewers: #11498 was closed by the reporter, but as far as I can tell the issue is still present on |
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.
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.