You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by rd...@apache.org on 2019/05/18 06:54:58 UTC
[pulsar] branch master updated: [pulsar-broker] add
valid-readPosition check before setting readPosition at cursor (#3881)
This is an automated email from the ASF dual-hosted git repository.
rdhabalia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new a207645 [pulsar-broker] add valid-readPosition check before setting readPosition at cursor (#3881)
a207645 is described below
commit a207645d919f322b6ecf5f3f652b4029bfad187c
Author: Rajan Dhabalia <rd...@apache.org>
AuthorDate: Fri May 17 23:54:51 2019 -0700
[pulsar-broker] add valid-readPosition check before setting readPosition at cursor (#3881)
* [pulsar-broker] add valid-readPosition check before setting readPosition at cursor
* fix test
---
.../java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
index 2a5b53c..54521e3 100644
--- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
+++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
@@ -1963,8 +1963,10 @@ public class ManagedCursorImpl implements ManagedCursor {
*/
void setReadPosition(Position newReadPositionInt) {
checkArgument(newReadPositionInt instanceof PositionImpl);
-
- this.readPosition = (PositionImpl) newReadPositionInt;
+ if (this.markDeletePosition == null
+ || ((PositionImpl) newReadPositionInt).compareTo(this.markDeletePosition) > 0) {
+ this.readPosition = (PositionImpl) newReadPositionInt;
+ }
}
// //////////////////////////////////////////////////