[ 
https://issues.apache.org/jira/browse/ARTEMIS-4193?focusedWorklogId=850030&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-850030
 ]

ASF GitHub Bot logged work on ARTEMIS-4193:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Mar/23 10:18
            Start Date: 09/Mar/23 10:18
    Worklog Time Spent: 10m 
      Work Description: 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.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 850030)
    Time Spent: 2h 20m  (was: 2h 10m)

> Interrupting Large Message Streaming with a server kill may leave orphaned 
> files
> --------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-4193
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4193
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.28.0
>            Reporter: Clebert Suconic
>            Priority: Major
>             Fix For: 2.29.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> There's a schema in the journal to store pending records before a file is 
> created.
> However the sync is not properly applied and if the server is killed it could 
> leave a few messages orphaned in the file system.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to