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

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

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

      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@mongodb.com Luke Pearson
            Reporter:
            luke.pearson@mongodb.com Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: