Skip to content

Commit

Permalink
Don't trigger node confirms failure if clock expected (#1858)
Browse files Browse the repository at this point in the history
When etching an object for replication, enough nodes are found if the expected clock is true - but that might then fail on node_confirms.  Don't generate the node_confirms response error if there has been a match on the expected clock
  • Loading branch information
martinsumner authored May 12, 2023
1 parent 0cf8272 commit e9c20a8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/riak_kv_get_core.erl
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,15 @@ enough(_) ->
%% Get success/fail response once enough results received
-spec response(getcore()) -> {reply(), getcore()}.
%% Met quorum for a standard get request/response
response(#getcore{node_confirms = RequiredConfirms,
confirmed_nodes = Nodes} = GetCore)
when length(Nodes) < RequiredConfirms ->
check_overload({error,
{insufficient_nodes,
length(Nodes), need, RequiredConfirms}}, GetCore);
response(
#getcore{
node_confirms = RqdConfirms,
confirmed_nodes = Nodes,
expected_fetchclock = ExpClock} = GetCore)
when (length(Nodes) < RqdConfirms andalso ExpClock =/= true) ->
check_overload(
{error, {insufficient_nodes, length(Nodes), need, RqdConfirms}},
GetCore);
%% Insufficient nodes confirmed
response(#getcore{r = R, num_ok = NumOK, pr= PR, num_pok = NumPOK,
expected_fetchclock = ExpClock, head_merge = HM} = GetCore)
Expand Down

0 comments on commit e9c20a8

Please sign in to comment.