Github user ehsavoie commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2474#discussion_r243331449
  
    --- 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 --
    
    There is already such an exception when creating the journal 
(java.lang.IllegalArgumentException: File size cannot be less than 1024 bytes
        Caused by: java.lang.IllegalArgumentException: File size cannot be less 
than 1024 bytes") . Would setting to high be acceptable ?


---

Reply via email to