Skip to content

Commit

Permalink
[pulsar-broker] add valid-readPosition check before setting readPosit…
Browse files Browse the repository at this point in the history
…ion at cursor (apache#3881)

* [pulsar-broker] add valid-readPosition check before setting readPosition at cursor

* fix test
  • Loading branch information
rdhabalia authored May 18, 2019
1 parent 831476b commit a207645
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1963,8 +1963,10 @@ public void asyncClose(final AsyncCallbacks.CloseCallback callback, final Object
*/
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;
}
}

// //////////////////////////////////////////////////
Expand Down

0 comments on commit a207645

Please sign in to comment.