Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-7469

Potential hot backup read lock never unlocked

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 5.1 Required
    • Component/s: None
    • Labels:
      None

      Description

      This code in conn_log.c appears to have an error:

              if (conn->hot_backup_start == 0 && conn->log_cursors == 0) {
                  WT_WITH_HOTBACKUP_READ_LOCK(session,
                    WT_ERR_ERROR_OK(
                      __wt_ftruncate(session, close_fh, close_end_lsn.l.offset), ENOTSUP, false),
                    NULL);
              }
       

      It's a problem to take an "early exit" (goto or return) out of a WT_WITH... macro, lest some resource be held.  In this case, the hotbackup read lock will be held if __wt_ftruncate fails.  We normally need to assign ret inside the WT_WITH... and check it outside the macro.

      See attached patch file - it contains a dist script to detect these sorts of errors.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-storage-engines Backlog - Storage Engines Team
            Reporter:
            donald.anderson Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: