gemmellr commented on code in PR #4395:
URL: https://github.com/apache/activemq-artemis/pull/4395#discussion_r1130770649


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java:
##########
@@ -3381,10 +3382,24 @@ synchronized void initialisePart2(boolean scalingDown) 
throws Exception {
 
       pagingManager.reloadStores();
 
-      JournalLoadInformation[] journalInfo = loadJournals();
+      Set<Long> storedLargeMessages = new HashSet<>();
+      JournalLoadInformation[] journalInfo = loadJournals(storedLargeMessages);
 
       if (rebuildCounters) {
-         pagingManager.rebuildCounters();
+         pagingManager.rebuildCounters(storedLargeMessages);
+
+         pagingManager.execute(() -> {
+            storedLargeMessages.forEach(id -> {
+               try {
+                  SequentialFile file = 
storageManager.createFileForLargeMessage(id, true);
+                  logger.debug("Removing pending large message for file={}", 
file);
+                  file.delete();
+               } catch (Exception e) {
+                  // this shouldn't really happen, unless something is off 
with the storage
+                  logger.warn("It was not possible to remove previously stored 
large message on folder::It will be retried on next startup::" + 
e.getMessage(), e);

Review Comment:
   Dont think you need to add the exception message, when adding the exception 
itself, just goign to end up with the message twice. (But if doing so, should 
use a placeholder rather than concat).
   
   It would however perhaps be good to add at least the message ID that the 
failure related to though otherwise it may just end up printing a bunch of 
similar or identical entries that dont make clear which message/files it 
relates to.



-- 
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