anchor.diff:                        }).
   
   -record(takeover_state, {owner :: {pid(), any()},
  -                         state :: requested | opaque_known,
  +                         state :: requested | opaque_known | active,
                            opaque :: integer(),
                            partition :: vbucket_id(),
  -                         requested_partition_state = none :: none | int_vb_state()
  +                         requested_partition_state = none :: none | int_vb_state(),
  +                         open_ack = false :: boolean()
                           }).
   
   -record(state, {state :: idle | #stream_state{} | #takeover_state{},
  
positive.code:                              [Partition, mc_client_binary:vbucket_state_to_atom(VbState)]),
              case VbState of
                  ?VB_STATE_ACTIVE ->
                      gen_server:reply(From, ok),
                      {proxy, State#state{state = idle}};
                  _ ->
                      {proxy, State#state{state =
                                              TakeoverState#takeover_state{
  
negative.code:     {block, maybe_reply_setup_streams(NewState#state{state = NewStreamState})};
  
  handle_packet(response, ?UPR_ADD_STREAM, Packet,
                #state{state = #takeover_state{owner = From, partition = Partition, open_ack = false}
                       = TakeoverState} = State, _ParentState) ->
  
      {Header, Body} = mc_binary:decode_packet(Packet),
      case {upr_commands:process_response(Header, Body), Header#mc_header.opaque} of
          {{ok, _}, Partition} ->
              NewTakeoverState = TakeoverState#takeover_state{open_ack = true},
              {block, maybe_reply_takeover(From, NewTakeoverState, State)};
          {Error, Partition} ->
              gen_server:reply(From, Error),
              {block, State#state{state = idle}};
          {_, WrongOpaque} ->
              ?rebalance_error("Unexpected response. Unrecognized opaque ~p~nHeader: ~p~nPartition: ~p",
                               [WrongOpaque, Header, Partition]),
              erlang:error({unrecognized_opaque, WrongOpaque, Partition})
      end;
  
  handle_packet(request, ?UPR_STREAM_REQ, Packet,
  