cshannon commented on code in PR #1142:
URL: https://github.com/apache/activemq/pull/1142#discussion_r1463434575


##########
activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java:
##########
@@ -1545,8 +1545,9 @@ long updateIndex(Transaction tx, KahaAddMessageCommand 
command, Location locatio
         if (previous == null) {
             previous = sd.messageIdIndex.put(tx, command.getMessageId(), id);
             if (previous == null) {
-                incrementAndAddSizeToStoreStat(tx, command.getDestination(), 
location.getSize());
                 sd.orderIndex.put(tx, priority, id, new 
MessageKeys(command.getMessageId(), location));

Review Comment:
   The entire method is already protected by the index write lock here: 
https://github.com/apache/activemq/blob/0b95f93449e58a855efd2fb03731432f396b18e1/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java#L1342
   
   This change is probably not even necessary since it's already under a lock 
and any exception should abort and shut things down normally but it just seemed 
to make more sense to not increment until adding to the index. but really it 
doesn't much matter since the index isn't commuted anyways if it isn't 
successful.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to