[ 
https://issues.apache.org/jira/browse/ARTEMIS-2224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16738734#comment-16738734
 ] 

ASF GitHub Bot commented on ARTEMIS-2224:
-----------------------------------------

Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2494#discussion_r246570293
  
    --- 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 --
    
    surely this is checking for something like if its -1? not just that its 
negative which would be worrying.... if so this should be more explicit to just 
be checking -1, and if anything else thats negative, means illegal argument


> Reduce contention on LivePageCacheImpl
> --------------------------------------
>
>                 Key: ARTEMIS-2224
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2224
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.7.0
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Major
>
> Has been measured that LIvePageCacheImpl operations are a source of 
> contention on producer side while paging. 
> This contention decrease the scalability of the broker in an evident way 
> while using topics, because the page cache is been accessed concurrently by 
> several producers to ack transactions while the messages are being appended.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to