anchor.diff:          end,
       {Result, R4, R4#rr_replies.highest_read_round}.
   
  --spec add_read_reply(replies(), dht_node_state:db_selector(),
  +-spec add_read_reply(#r_replies{}, dht_node_state:db_selector(),
                        pr:pr(),  client_value(),  pr:pr(),
                        pr:pr(), module(), any(), Consistency::boolean())
  -                    -> {Done::boolean() | write_through, replies(), pr:pr()}.
  +                    -> {Done::boolean() | write_through, #r_replies{}, pr:pr()}.
   add_read_reply(Replies, _DBSelector, AssignedRound, Val, SeenWriteRound,
                  CurrentRound, Datatype, Filters, _Cons) ->
       %% either decide on a majority of consistent replies, than we can
  
positive.code:     %% Otherwise we decide on a consistent quorum (a majority agrees
      %% on the same version). We ensure this by write_through on odd
      %% cases.
      MaxWriteR = replies_max_write_r(Replies),
      %% extract write through info for round comparisons since
      %% they can be key-dependent if something different than
      %% replication is used for redundancy
      MaxWriteRNoWTInfo = pr:set_wf(MaxWriteR, none),
      SeenWriteRoundNoWTInfo = pr:set_wf(SeenWriteRound, none),
      R1 =
          if SeenWriteRoundNoWTInfo > MaxWriteRNoWTInfo ->
                  T1 = replies_set_max_write_r(Replies, SeenWriteRound),
                  T2 = replies_set_num_newest(T1, 1),
                  NewVal = ?REDUNDANCY:collect_newer_read_value(replies_val(T2),
                                               Val, Datatype),
                  replies_set_val(T2, NewVal);
             SeenWriteRoundNoWTInfo =:= MaxWriteRNoWTInfo ->
                  %% ?DBG_ASSERT2(Val =:= replies_val(Replies),
                  %%    {collected_different_values_with_same_round,
                  %%     Val, replies_val(Replies), proto_sched:get_infos()}),
  
                  %% ?DBG_ASSERT2(Val =:= replies_val(Replies),
                  %%    {collected_different_values_with_same_round,
                  %%     Val, replies_val(Replies), proto_sched:get_infos()}),
                  NewVal = ?REDUNDANCY:collect_read_value(replies_val(Replies),
                                               Val, Datatype),
                  T1 = replies_set_val(Replies, NewVal),
                  replies_inc_num_newest(T1);
             true ->
                 NewVal = ?REDUNDANCY:collect_older_read_value(replies_val(Replies),
                                              Val, Datatype),
                 replies_set_val(Replies, NewVal)
      end,
      NewRound = erlang:max(CurrentRound, AssignedRound),
  
      R2 = replies_inc_num_acks(R1),
      R2NumAcks = replies_num_acks(R2),
      R2RF = case Filters of
                 {RF, _, _} -> RF;
                 RF         -> RF
             end,
      {Result, R4} =
          case ?REDUNDANCY:quorum_accepted(R2NumAcks) of
              true ->
                  %% we have majority of acks
  
                  %% construct read value from replies
                  Collected = replies_val(R2),
                  Constructed = ?REDUNDANCY:get_read_value(Collected, R2RF),
                  R3 = replies_set_val(R2, Constructed),
  
                  Done = case replies_num_newest(R3) =:= R2NumAcks orelse
                              ?REDUNDANCY:skip_write_through(Constructed) of
                              true -> true; %% done
                              _ -> write_through
  
negative.code:                      read_value :: any()                        %% value returned from the round_request
                      }).
  
  %% Aggregator for read replies.
  %% If qread phase 1 has not found a consistent quorum, a read with an explicit
  %% round number is startet. The replies are aggregated in this record.
  -record(r_replies, {ack_count :: non_neg_integer(),             %% number of acks reveiced
                      deny_count :: non_neg_integer(),            %% number of denies received
                      highest_write_count :: non_neg_integer(),   %% number of replies with current highest write round
                      highest_write_round :: pr:pr(),             %% highest write round received
                      read_value :: any()                         %% value returned frm read request
                     }).
  
  -type replies() :: gen_replies() | #rr_replies{} | #r_replies{}.
  
  -type entry() :: {any(), %% ReqId
                    any(), %% debug field
  