activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuconic <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #2474: [ARTEMIS-1536]: Incorrect Journal files...
Date Thu, 20 Dec 2018 14:09:29 GMT
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2474#discussion_r243283678
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JournalStorageManager.java
---
    @@ -163,13 +163,17 @@ protected void init(Configuration config, IOCriticalErrorListener
criticalErrorL
     
           int fileSize = config.getJournalFileSize();
           // we need to correct the file size if its not a multiple of the alignement
    -      int modulus = fileSize % journalFF.getAlignment();
    -      if (modulus != 0) {
    -         int difference = modulus;
    -         int low = config.getJournalFileSize() - difference;
    -         int high = low + journalFF.getAlignment();
    -         fileSize = difference < journalFF.getAlignment() / 2 ? low : high;
    -         ActiveMQServerLogger.LOGGER.invalidJournalFileSize(config.getJournalFileSize(),
fileSize, journalFF.getAlignment());
    +      if (fileSize <= journalFF.getAlignment()) {
    +         fileSize = journalFF.getAlignment();
    --- End diff --
    
    I would actually throw an exception here. I wouldn't expect a block size that low. you
can only have the header on the journal and nothing else if you specify fileSize == alignment.


---

Mime
View raw message