BTM
  1. BTM
  2. BTM-21

Differing journal-file lengths cause BTM to fail to start even if skipCorrectedLogs is true

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Despite setting bitronix.tm.journal.disk.skipCorruptedLogs=true, if the journal-file lengths differ then BTM won't start. Attached is a simple patch to fix this.

        Activity

        Hide
        Ludovic Orban added a comment -

        I will consider this patch but I wonder what motivates such change. Could you please elaborate ?

        Show
        Ludovic Orban added a comment - I will consider this patch but I wonder what motivates such change. Could you please elaborate ?
        Hide
        Ronald Tschalär added a comment -

        Especially when running unit (and other) tests in parallel it's too much of a pain to configure separate journal locations for all the various pieces, so they all share and ignore the same journal files. This of course leads to corrupted journals, but we really don't care, and we therefore have skipCorruptedLogs=true. But that only works some of the time, and not when the corruption manifests itself as log files having different lengths.

        Similarly, during development things are often stopped abruptly, leading to corrupted journals, and again we really don't care (ideally we'd also like to just completely disable the journals). Since skipCorruptedLogs is supposed to ignore corrupted logs, I think it should do so also if the corruption manifests itself as different files lengths, not just if the contents of the journals are corrupted.

        Show
        Ronald Tschalär added a comment - Especially when running unit (and other) tests in parallel it's too much of a pain to configure separate journal locations for all the various pieces, so they all share and ignore the same journal files. This of course leads to corrupted journals, but we really don't care, and we therefore have skipCorruptedLogs=true. But that only works some of the time, and not when the corruption manifests itself as log files having different lengths. Similarly, during development things are often stopped abruptly, leading to corrupted journals, and again we really don't care (ideally we'd also like to just completely disable the journals). Since skipCorruptedLogs is supposed to ignore corrupted logs, I think it should do so also if the corruption manifests itself as different files lengths, not just if the contents of the journals are corrupted.
        Hide
        Ludovic Orban added a comment -

        Having two processes write to the same disk journal is allowed in version 1.2 and lower on non-Windows platforms because of a bug in the TransactionLogAppender. This has been fixed in version 1.3 so I'm afraid this will break your parallel unit tests.

        I think I will apply your patch anyway but we should agree on a real feature and not a workaround to allow you to run your tests in parallel.

        Show
        Ludovic Orban added a comment - Having two processes write to the same disk journal is allowed in version 1.2 and lower on non-Windows platforms because of a bug in the TransactionLogAppender. This has been fixed in version 1.3 so I'm afraid this will break your parallel unit tests. I think I will apply your patch anyway but we should agree on a real feature and not a workaround to allow you to run your tests in parallel.
        Hide
        Ronald Tschalär added a comment -

        I agree. I think the "real" feature would be to be able to completely disable the journal. For this just simply being able to set a journal in TransactionManagerServices would cover it, and possibly also providing a NullJournal for convenience.

        Show
        Ronald Tschalär added a comment - I agree. I think the "real" feature would be to be able to completely disable the journal. For this just simply being able to set a journal in TransactionManagerServices would cover it, and possibly also providing a NullJournal for convenience.
        Hide
        Ludovic Orban added a comment -

        Fixed in trunk. Also implemented a NullJournal that can be configured with Configuration.setJournal("null")

        Show
        Ludovic Orban added a comment - Fixed in trunk. Also implemented a NullJournal that can be configured with Configuration.setJournal("null")
        Hide
        Ronald Tschalär added a comment -

        Perfect! Thank you.

        Show
        Ronald Tschalär added a comment - Perfect! Thank you.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Ronald Tschalär
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: