cshannon commented on code in PR #1142:
URL: https://github.com/apache/activemq/pull/1142#discussion_r1463450283
##########
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:
Yeah your comment was good as it made me realize that change was pointless
as I forgot the index isn't even committed until after the transaction
completes. One could argue we could wait to update the counters until after
transaction finishes but that would be a much larger change and tricky to
guarantee things are in fact still atomic since you process it later outside of
where you have the information you need and the lock. Plus the default behavior
is to shutdown the broker on IoException anyways. The current behavior has been
fine for many years so don't need to change it I don't think.
--
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]