docs: void writeSections(boolean rewriteRequired) throws InternalLogException
      {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "writeSections", new java.lang.Object[] { this, new Boolean(rewriteRequired) });
  
          // If the parent recovery log instance has experienced a serious internal error then prevent
          // this operation from executing.
          if (_recLog.failed())
          {
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "writeSections", "InternalLogException");
              throw new InternalLogException(null);
          }
  
          // If the log was not open then throw an exception
          if (_logHandle == null)
          {
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "writeSections", "InternalLogException");
              throw new InternalLogException(null);
          }
  
          _controlLock.getSharedLock(LOCK_REQUEST_ID_RUI_WRITESECTIONS);
  
          // If there is data stored within this recoverable unit that has not yet been
          // persisted to disk or there is existing data and a rewrite is being performed
          // then (re)persist the required data.
          if ((_unwrittenDataSize > 0) || (rewriteRequired && (_totalDataSize > 0)))
          {
              try
              {
                  if (tc.isDebugEnabled())
                      Tr.debug(tc, "Writing recoverable unit '" + _identity + "'");
  
                  if (tc.isDebugEnabled())
                      Tr.debug(tc, "Unwritten data size = " + _unwrittenDataSize + " total data size = " + _totalDataSize);
  
                  int requiredRecordSize = _recordHeaderSize;
  
                  if (rewriteRequired)
                  {
                      requiredRecordSize += _totalDataSize;
                  }
                  else
                  {
                      requiredRecordSize += _unwrittenDataSize;
                  }
  
                  // Obtain a WritableLogRecord that provides direct access to the underlying recovery log.
                  // The WritableLogRecord will write the required log record header to the underlying
                  // recovery log.
                  final WriteableLogRecord logRecord = _logHandle.getWriteableLogRecord(requiredRecordSize);
  
                  // In some situations, there will not be enough space in the underlying recovery to obtain a
                  // WritableLogRecord of the required size. The recovery log will need to perform "housekeeping"
                  // to clean up the recovery log before this latest record can be written. In such
                  // situations, the getWritableLogRecord() will trigger a keypoint operation before returning. 
                  // Given that the keypoint operation will actually cause all the information within this
                  // recoverable unit to be (re)written to disk, this method need take no further action. This
                  // condition is indicated by the return of a null log record.
                  if (logRecord != null)
                  {
                      writeRecordHeader(logRecord, RECORDTYPENORMAL);
  
                      // Obtain an iterator that can be used to access each of the recoverable unit sections in turn.
                      Iterator recoverableUnitSectionsIterator = _recoverableUnitSections.values().iterator();
  
                      while (recoverableUnitSectionsIterator.hasNext())
                      {
                          RecoverableUnitSectionImpl section = (RecoverableUnitSectionImpl) (recoverableUnitSectionsIterator.next());
  
                          // Now direct the recoverable unit section to write its content. If the recoverable unit 
                          // section has no data to write then this will be a no-op.
                          section.format(rewriteRequired, logRecord);
                      }
  
                      // Finally write a negative recoverable unit section id to indicate the there are no
                      // more sections.
                      logRecord.putInt(END_OF_SECTIONS);
  
                      // Tell the WritableLogRecord that we have finished adding recoverable unit sections. This
                      // will cause it to add the appropriate record tail to the underlying recovery log.
                      logRecord.close();
  
                      // Flag the fact that this recoverable unit has now been written to the underlying recovery log.
                      _storedOnDisk = true;
  
                      _logHandle.writeLogRecord(logRecord);
                  }
              } catch (IOException exc)
              {
                  FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "383", this);
                  if (tc.isEventEnabled())
                      Tr.event(tc, "An unexpected error IO occurred whilst formatting the recovery log buffer", exc);
  
                  _recLog.markFailed(exc); /* @MD19484C */
  
                  try
                  {
                      _controlLock.releaseSharedLock(LOCK_REQUEST_ID_RUI_WRITESECTIONS);
                  } catch (Throwable exc2)
                  {
                      FFDCFilter.processException(exc2, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "392", this);
                      if (tc.isEntryEnabled())
                          Tr.exit(tc, "writeSections", "InternalLogException");
                      throw new InternalLogException(exc2);
                  }
  
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "writeSections", "InternalLogException");
                  throw new InternalLogException(exc);
              } catch (InternalLogException exc)
              {
                  FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "587", this);
                  if (tc.isEventEnabled())
                      Tr.event(tc, "An InternalLogException exception occured whilst formatting the recovery log buffer", exc);
  
                  _recLog.markFailed(exc); /* @MD19484C */
  
                  try
                  {
                      _controlLock.releaseSharedLock(LOCK_REQUEST_ID_RUI_WRITESECTIONS);
                  } catch (Throwable exc2)
                  {
                      FFDCFilter.processException(exc2, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "392", this);
                      // The shared lock release has failed whilst procesing the initial InternalLogExcption failure. Because
                      // this may be a LogFullException (which extends InternalLogException), rather than re-generating the
                      // exception just allow the original to return.
                  }
  
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "writeSections", exc);
                  throw exc;
              } catch (Throwable exc)
              {
                  FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "402", this);
                  if (tc.isEventEnabled())
                      Tr.event(tc, "An unexpected error occurred whilst formatting the recovery log buffer", exc);
  
                  _recLog.markFailed(exc); /* @MD19484C */
  
                  try
                  {
                      _controlLock.releaseSharedLock(LOCK_REQUEST_ID_RUI_WRITESECTIONS);
                  } catch (Throwable exc2)
                  {
                      FFDCFilter.processException(exc2, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "411", this);
                      if (tc.isEntryEnabled())
                          Tr.exit(tc, "writeSections", "InternalLogException");
                      throw new InternalLogException(exc2);
                  }
  
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "writeSections", "InternalLogException");
                  throw new InternalLogException(exc);
              }
          }
          else
          {
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "RecoverableUnitImpl has no RecoverableUnitSections that need to be added to the disk record");
          }
  
          try
          {
              _controlLock.releaseSharedLock(LOCK_REQUEST_ID_RUI_WRITESECTIONS);
          } catch (NoSharedLockException exc)
          {
              FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.RecoverableUnitImpl.writeSections", "474", this);
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "writeSections", "InternalLogException");
              throw new InternalLogException(exc);
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "writeSections");
      }