anchor.diff:  
       ?assertMatch([{set, {node, _, memcached}, [{engines, [something]},
                                                  {ssl_port, 1}, {verbosity, 2},
  -                                               {port, 3}]}],
  +                                               {port, 3}]},
  +                  {set, {node, _, memcached_config}, memcached_config}],
                    do_upgrade_config_from_3_0_to_3_0_1(Cfg, Default)).
   
   
  
positive.code:     McdConfigKey = {node, node(), memcached_config},
      {value, DefaultMcdConfig} = ns_config:search([DefaultConfig], McdConfigKey),
  
      %% MB-12655: we 'upgrade' all per node keys of this node to include vclock.
      %%
      %% NOTE: that on brand new installations of 3.0+ we already force
      %% all per-node keys to have vclocks as part of work on
      %% MB-10254. At the time of this writing it is done as part of
      %% ns_config initialization
      %%
      %% NOTE: that this was added for 3.0.2 release, retrofitting "to
      %% 3.0" config upgrade. That is ok given that even 3.0.0 should be
      %% okay with such config upgrade. And given that for nodes already
      %% affected by MB-12655, there's specific way to unbreak them. And
      %% also given that (healthy) 3.0 nodes don't need such upgrade
      %% because they have vclocks for per-node keys already. Doing it
      %% for 3.0 also makes it much simpler to merge it between 3.0.2, 3.1
      %% and master branches.
      PerNodeKeyTouchings = [{set, K, V}
                             || {{node, N, KN} = K, V} <- ns_config:get_kv_list_with_config(Config),
                                N =:= node(),
                                KN =/= config_version,
                                KN =/= memcached,
                                KN =/= memcached_config,
                                KN =/= port_servers],
  
      upgrade_memcached_ssl_port_and_verbosity(Config, DefaultConfig) ++
          PerNodeKeyTouchings ++
          [{set, PortServersKey, DefaultPortServers},
           {set, McdConfigKey, DefaultMcdConfig}].
  
  upgrade_memcached_ssl_port_and_verbosity(Config, DefaultConfig) ->
      McdKey = {node, node(), memcached},
  
      {value, McdConfig} = ns_config:search(Config, McdKey),
      {value, DefaultMcdConfig} = ns_config:search([DefaultConfig], McdKey),
  
      NewOrUpdatedParams =
          lists:filter(
            fun ({Key, _Value}) ->
                    lists:member(Key, [ssl_port, verbosity])
            end, DefaultMcdConfig),
  
      StrippedMcdConfig =
          lists:filter(
            fun ({Key, _Value}) ->
                    not lists:keymember(Key, 1, NewOrUpdatedParams)
            end, McdConfig),
  
      [{set, McdKey, NewOrUpdatedParams ++ StrippedMcdConfig}].
  
  upgrade_config_from_3_0_to_3_0_1(Config) ->
      ?log_info("Upgrading config from 3.0 to 3.0.1"),
      DefaultConfig = default(),
      do_upgrade_config_from_3_0_to_3_0_1(Config, DefaultConfig).
  
  do_upgrade_config_from_3_0_to_3_0_1(Config, DefaultConfig) ->
      McdKey = {node, node(), memcached},
      {value, DefaultMcdConfig} = ns_config:search([DefaultConfig], McdKey),
      {value, CurrentMcdConfig} = ns_config:search(Config, McdKey),
      EnginesTuple = {engines, _} = lists:keyfind(engines, 1, DefaultMcdConfig),
      NewMcdConfig = lists:keystore(engines, 1, CurrentMcdConfig, EnginesTuple),
      [{set, McdKey, NewMcdConfig}].
  
  search_sub_key(Config, Key, Subkey) ->
      case ns_config:search(Config, Key) of
  
negative.code: 
  upgrade_2_3_0_to_3_0_test() ->
      Cfg = [[{some_key, some_value},
              {{node, node(), memcached},
               [{ssl_port, 1}, {verbosity, "-v"}, {port, 3}]},
              {{node, node(), memcached_config}, memcached_config}]],
  