Refactor wt util tool to remove redundant variables in config handling

XMLWordPrintableJSON

    • Storage Engines, Storage Engines - Foundations
    • SE Persistence - 2025-08-15
    • 1

      In src/utilities/util_main.c within the switch statement, the current implementation sets both the config variables (e.g. readonly_config, salvage_config) and the corresponding boolean flags (e.g. readonly, salvage)

      However, these config variables are redundant because the boolean flags alone are enough to determine the behaviour.

      I.e. Instead of:

      ...
      case 'r':
      readonly_config = READONLY;
      readonly = true;
      break;
      
      case 'S': /* salvage */
      salvage_config = SALVAGE;
      salvage = true;
      break;
      ...

      Do:

      ...
      case 'r': 
      readonly = true; 
      break;
      
      case 'S': /* salvage */ 
      salvage = true; 
      break; 
      ...

       

      Ensure that any code relying on the configuration variables is updated to use the boolean flags instead. For example:

      if (readonly_config != NULL)
      len += strlen(readonly_config); 

      Should be refactored to:

      if (readonly)
      conn_config = READONLY;
      

       

              Assignee:
              Albert Song
              Reporter:
              Mariam Mojid
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: