This commit is contained in:
Michael Pearce 2019-08-19 16:46:12 +01:00
commit 9cb689fa41
2 changed files with 10 additions and 0 deletions

View File

@ -491,6 +491,7 @@ public final class Page implements Comparable<Page> {
logger.debug("Deleting pageNr=" + pageId + " on store " + storeName);
}
List<Long> largeMessageIds = new ArrayList<>();
if (messages != null) {
for (PagedMessage msg : messages) {
if (msg.getMessage() instanceof ICoreMessage && (msg.getMessage()).isLargeMessage()) {
@ -500,11 +501,15 @@ public final class Page implements Comparable<Page> {
// Because the large-message may be linked to another message
// or it may still being delivered even though it has been acked already
lmsg.decrementDelayDeletionCount();
largeMessageIds.add(lmsg.getMessageID());
}
}
}
try {
if (!storageManager.waitOnOperations(5000)) {
ActiveMQServerLogger.LOGGER.timedOutWaitingForLargeMessagesDeletion(largeMessageIds);
}
if (suspiciousRecords) {
ActiveMQServerLogger.LOGGER.pageInvalid(file.getFileName(), file.getFileName());
file.renameTo(file.getFileName() + ".invalidPage");

View File

@ -2016,4 +2016,9 @@ public interface ActiveMQServerLogger extends BasicLogger {
@Message(id = 224099, value = "Message with ID {0} has a header too large. More information available on debug level for class {1}",
format = Message.Format.MESSAGE_FORMAT)
void messageWithHeaderTooLarge(Long messageID, String loggerClass);
@LogMessage(level = Logger.Level.INFO)
@Message(id = 224100, value = "Timed out waiting for large messages deletion with IDs {0}, might not be deleted if broker crashes atm",
format = Message.Format.MESSAGE_FORMAT)
void timedOutWaitingForLargeMessagesDeletion(List<Long> largeMessageIds);
}