Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2939

Log file is flushed every time a log buffer gets full

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.1.4, 10.4.1.3
    • 10.4.1.3
    • Store
    • None

    Description

      LogAccessFile consists of a number of log buffers: LinkedList<LogAccessFileBuffer> freeBuffers and dirtyBuffers, and LogAccessFileBuffer currentBuffer.

      When a log record is written to log, writeLogRecord wrongly assumes that the log record is too big to fit in any log buffer if there is not enough free space in the current log buffer. The code:

      if (total_log_record_length <= currentBuffer.bytes_free) {
      <append log record to current buffer>
      ...
      } else {
      <log record too big to fit in any buffer>
      ...
      }

      should be modified to:

      if (total_log_record_length <= currentBuffer.bytes_free) {
      <append log record to current buffer>
      ...
      } else if (total_log_record_length <= currentBuffer.length) {
      <swap log buffer>
      <append log record to new current buffer>
      ...
      } else {
      <log record too big to fit in any buffer>
      ...
      }

      Attachments

        1. derby-2939-3bugfix.diff
          14 kB
          Jorgen Loland
        2. derby-2939-3.diff
          14 kB
          Jorgen Loland
        3. derby-2939-2.diff
          12 kB
          Jorgen Loland
        4. derby-2939-2.stat
          0.1 kB
          Jorgen Loland
        5. derby-2939-1.diff
          11 kB
          Jorgen Loland
        6. derby-2939-1.stat
          0.1 kB
          Jorgen Loland

        Activity

          People

            jorgenlo Jorgen Loland
            jorgenlo Jorgen Loland
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: