Terminate the os posix file system if live restore file system startup fails

XMLWordPrintableJSON

    • Storage Engines
    • StorEng - 2025-02-28
    • 3

      Right now there is a memory leak if we encounter an error setting up the live restore file system after we create the underlying posix file system.

      Patch:

      diff --git a/src/live_restore/live_restore_fs.c b/src/live_restore/live_restore_fs.c
      index c0c772286..8e6fb165b 100644
      --- a/src/live_restore/live_restore_fs.c
      +++ b/src/live_restore/live_restore_fs.c
      @@ -1927,6 +1927,8 @@ __wt_os_live_restore_fs(
           F_SET(S2C(session), WT_CONN_LIVE_RESTORE_FS);
           if (0) {
       err:
      +        if (lr_fs->os_file_system != NULL)
      +            lr_fs->os_file_system->terminate(lr_fs->os_file_system, session);
               __wt_free(session, lr_fs->source.home);
               __wt_free(session, lr_fs);
           }
      
      

              Assignee:
              Luke Pearson
              Reporter:
              Luke Pearson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: