ARTEMIS-4298 and ARTEMIS-4215 Fixing duplicated entries on historyFiles on journalRetention during a replication

This is Fixing BackupSyncJournalTest::testReplicationDuringSync

ARTEMIS-4215 introduced a failure on the testsuite.
However the failure is non related to the Buffer itself. it introduced a race that unveiled ARTEMIS-4298.
This commit is contained in:
clebert 2023-05-31 12:52:18 -04:00 committed by clebertsuconic
parent e7de2c7001
commit c5be8b72c1
2 changed files with 3 additions and 0 deletions

View File

@ -2933,6 +2933,8 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
fileFactory.stop();
historyPendingFiles.clear();
currentFile = null;
} finally {
journalLock.writeLock().unlock();

View File

@ -1716,6 +1716,7 @@ public abstract class AbstractJournalStorageManager extends CriticalComponentImp
if (config.getJournalRetentionLocation() != null) {
messageJournal.getFileFactory().start();
messageJournal.setHistoryFolder(config.getJournalRetentionLocation(), config.getJournalRetentionMaxBytes(), config.getJournalRetentionPeriod());
}
messageJournal.start();