-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] [txn] Get previous position by managed ledger. #22024
Conversation
...r/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a test for this change
...r/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
Outdated
Show resolved
Hide resolved
I think existing tests could cover the case. |
faf485b
to
b9b8913
Compare
PTAL, thanks. @dao-jun @congbobo184 @liangyepianzhou |
/pulsarbot rerun-failure-checks |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #22024 +/- ##
============================================
- Coverage 73.57% 73.54% -0.03%
+ Complexity 32575 32049 -526
============================================
Files 1874 1874
Lines 139252 139252
Branches 15260 15260
============================================
- Hits 102454 102413 -41
- Misses 28880 28916 +36
- Partials 7918 7923 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 - 1
is 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
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: thetumbled#42