anchor.diff:  %% @doc Close a storage
   %% @private
   close_storage(Id, MetaDBId, StateFilePath,
  -              StorageStats, WriteHandler, ReadHandler) when is_list(StateFilePath) ->
  +              StorageStats, WriteHandler, ReadHandler, Reason) when is_list(StateFilePath) ->
       _ = filelib:ensure_dir(StateFilePath),
       _ = leo_file:file_unconsult(
             StateFilePath,
  
positive.code:                           [{module, ?MODULE_STRING}, {function, "terminate/2"},
                             {line, ?LINE}, {body, Id}]),
      ok = close_storage(Id, MetaDBId, StateFilePath,
                         StorageStats, WriteHandler, ReadHandler),
      ok.
  
  %% @doc Convert process state when code is changed
  
negative.code:            {compaction_hist, StorageStats#storage_stats.compaction_hist}
            ]),
      catch leo_object_storage_haystack:close(WriteHandler, ReadHandler),
      case Reason of
          normal_shutdown ->
              % call leo_backend_db_server:close only when leo_storage stop
              catch leo_backend_db_server:close(MetaDBId);
          _ ->
              nop
      end,
      ok;
  close_storage(_,_,_,_,_,_,_) ->
      ok.
  