fix(proxy): keep sub-second bounds on admin message queries - #11235
Open
3219378872 wants to merge 1 commit into
Open
3219378872 wants to merge 1 commit into
3219378872 wants to merge 1 commit into
Conversation
QueryMessage converted protobuf Timestamps with getSeconds() only, so the inclusive millisecond window passed to the broker shifted by up to 999ms. ResetGroupOffset already kept nanos. Share that seconds-plus-nanos conversion for the query begin and end. Fixes apache#11234
Author
|
The seven GitHub Actions workflows for head Could a maintainer approve the pending workflow runs when convenient? The 61 local |
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
Fixes #11234.
Brief Description
ProxyAdminGrpcService.queryMessageconvertedListMessageRequestbegin/end timestamps withgetSeconds()only.Timestamps.fromMillisstores the fractional second innanos, so a window such as[1700000000500, 1700000001250]was sent to the broker as[1700000000000, 1700000001000]. The broker index compares those bounds with millisecond store timestamps, inclusive, so the window can shift by up to 999ms.The query bounds now use the same seconds-plus-nanos conversion
ResetGroupOffsetalready uses. Unset bounds stay0andLong.MAX_VALUE.GrpcConverteris unchanged, including the receive-pathTIMER_DELAY_SECdelivery timestamp covered by #10686.How Did You Test This Change?
ProxyAdminGrpcServiceTest#queryMessagePreservesSubSecondTimeRangeTestfailed on the unmodified proxy: the mockedAdminService.queryMessagewas invoked with1700000000000and1700000001000. After the fix, the same test expects and observes1700000000500and1700000001250.The whole
ProxyAdminGrpcServiceTestclass then passed: 61 tests, 0 failures, checkstyle 0 violations. JDK 8 (Temurin 8u504-b01) and Maven 3.8.7. JDK 21 cannot load the pinned Mockito agent for this module. No live broker was required: the defect is the bounds passed intoAdminService.queryMessage.mvn -B -ntp -pl proxy -am test \ -Dtest=ProxyAdminGrpcServiceTest \ -DfailIfNoTests=false -Dspotbugs.skip=truePrepared with AI assistance.