From ced3e4bc55fff61e6891f7fab824b1beaba1f7d4 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Wed, 19 Apr 2023 14:44:38 +0100 Subject: [PATCH] Don't trigger node confirms failure if clock expected 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 --- src/riak_kv_get_core.erl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/riak_kv_get_core.erl b/src/riak_kv_get_core.erl index ffd8df575..811bfa57f 100644 --- a/src/riak_kv_get_core.erl +++ b/src/riak_kv_get_core.erl @@ -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)