[fix] [txn] Get previous position by managed ledger.#22024
[fix] [txn] Get previous position by managed ledger.#22024dao-jun merged 2 commits intoapache:masterfrom
Conversation
congbobo184
left a comment
There was a problem hiding this comment.
please add a test for this change
I think existing tests could cover the case. |
faf485b to
b9b8913
Compare
|
PTAL, thanks. @dao-jun @congbobo184 @liangyepianzhou |
|
/pulsarbot rerun-failure-checks |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22024 +/- ##
============================================
+ Coverage 73.57% 73.62% +0.05%
- Complexity 32575 32582 +7
============================================
Files 1874 1874
Lines 139252 139252
Branches 15260 15260
============================================
+ Hits 102454 102528 +74
+ Misses 28880 28816 -64
+ Partials 7918 7908 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
liangyepianzhou
left a comment
There was a problem hiding this comment.
Good catch. Please help supplement the testing.
|
Hi, I have add a test to produce a exception, and it is necessary to fix this problem. |
|
@dao-jun It's better to check which branches we need to release before merging. |
|
This fails the build in branch-3.0 now. Please help to fix this issue. |
@Technoboy- can this be reverted from branch-3.0 ? |
It seems that the problem has been fixed by @Technoboy. |
@thetumbled How was it fixed? we need the fix to branch-3.0 . |
commit: 5578873 |
|
@thetumbled Thanks. There's a test failure in branch-3.0 too, to reproduce: |
Let me take a look at this issue. |
Revert this pr and the test still failed |
The problem is fixed by pr: #22130 |
(cherry picked from commit 98ce27e)
(cherry picked from commit 98ce27e)

Motivation
Max read position is before the first ongoing txn's position. But the entry id of the first message may be 0, calculate the max read position by
entry id - 1is unsafe.Modifications
Calculate the max read position by method
managedLedger.getPreviousPosition.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: thetumbled#42