anchor.diff:          lists:foldl(fun ({set, K,V}, Acc) ->
                               case lists:keyfind(K, 1, Acc) of
                                   false ->
  -                                    [{K,V} | Acc];
  +                                    [{K, attach_vclock(V)} | Acc];
                                   {K, OldV} ->
                                       NewV =
                                           case is_list(OldV) of
                                               true ->
                                                   case proplists:get_value(?METADATA_VCLOCK, OldV) of
                                                       undefined ->
  -                                                        %% no vclock on old value, don't set it
  -                                                        V;
  +                                                        %% we encountered plenty of upgrade
  +                                                        %% problems coming from the fact that
  +                                                        %% both old and new values miss vclock;
  +                                                        %% in this case the new value can be
  +                                                        %% reverted by the old value replicated
  +                                                        %% from not yet updated node;
  +                                                        %% we solve this by attaching vclock to
  +                                                        %% new value;
  +                                                        %% actually we're not supposed to update
  +                                                        %% not per-node values; but we still attach
  +                                                        %% vclock to them mostly for uniformity;
  +                                                        attach_vclock(V);
                                                       _ ->
                                                           increment_vclock(V, OldV)
                                                   end;
  -                                            _ -> V
  +                                            _ ->
  +                                                attach_vclock(V)
                                           end,
                                       lists:keyreplace(K, 1, Acc, {K, NewV})
                               end
  
positive.code:         ],
      [upgrade_config_testgen(I, C, E) || {I,C,E} <- T].
  
  
  upgrade_config_with_many_upgrades_test_() ->
      {spawn, ?_test(test_upgrade_config_with_many_upgrades())}.
  
negative.code:             [{?METADATA_VCLOCK, NewVClock} | strip_metadata(NewValue)]
      end.
  
  attach_vclock(Value) ->
      VClock = lists:sort(vclock:increment(node(), vclock:fresh())),
      [{?METADATA_VCLOCK, VClock} | strip_metadata(Value)].
  
  %% gen_server callbacks
  
  upgrade_config(Config) ->
  