Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2494#discussion_r246570552 --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java --- @@ -864,21 +875,32 @@ private PageCursorInfo processACK(final PagePosition pos) { return info; } + private void installTXCallback(final Transaction tx, final PagePosition position) { + installTXCallback(tx, position, -1); + } + /** * @param tx * @param position + * @param persistentSize if negative it needs to be calculated on the fly */ - private void installTXCallback(final Transaction tx, final PagePosition position) { + private void installTXCallback(final Transaction tx, final PagePosition position, final long persistentSize) { if (position.getRecordID() >= 0) { // It needs to persist, otherwise the cursor will return to the fist page position tx.setContainsPersistent(); } PageCursorInfo info = getPageInfo(position); PageCache cache = info.getCache(); - long size = 0; if (cache != null) { - size = getPersistentSize(cache.getMessage(position.getMessageNr())); + final long size; + if (persistentSize < 0) { --- End diff -- -1 is used as a reserved value in another point to trigger the cache lookup
---