This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push:
new 0167ab953 Use "all" ring options for purged_infos
0167ab953 is described below
commit 0167ab95331862427562f1aa3c03a1deb5a44b26
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Wed Oct 29 01:43:02 2025 -0400
Use "all" ring options for purged_infos
Previously we used the `{any, Shards}` option, that option is most useful
for
partitioned dbs when we may want to get results from any of the partitioned
shards (possibly non-exactly matching with start/ends after shards
splitting).
For purged_infos using `all` is more appropriate and this makes it more
clear
we wait for all viable shards to return.
---
src/fabric/src/fabric_db_purged_infos.erl | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/fabric/src/fabric_db_purged_infos.erl
b/src/fabric/src/fabric_db_purged_infos.erl
index 45f5681b6..b1c5a606e 100644
--- a/src/fabric/src/fabric_db_purged_infos.erl
+++ b/src/fabric/src/fabric_db_purged_infos.erl
@@ -18,8 +18,7 @@
-record(pacc, {
counters,
- replies,
- ring_opts
+ replies
}).
go(DbName) ->
@@ -29,8 +28,7 @@ go(DbName) ->
Fun = fun handle_message/3,
Acc0 = #pacc{
counters = fabric_dict:init(Workers, nil),
- replies = couch_util:new_set(),
- ring_opts = [{any, Shards}]
+ replies = couch_util:new_set()
},
try
case fabric_util:recv(Workers, #shard.ref, Fun, Acc0) of
@@ -48,17 +46,17 @@ go(DbName) ->
end.
handle_message({rexi_DOWN, _, {_, NodeRef}, _}, _Shard, #pacc{} = Acc) ->
- #pacc{counters = Counters, ring_opts = RingOpts} = Acc,
- case fabric_util:remove_down_workers(Counters, NodeRef, RingOpts) of
+ #pacc{counters = Counters} = Acc,
+ case fabric_util:remove_down_workers(Counters, NodeRef, [all]) of
{ok, NewCounters} ->
{ok, Acc#pacc{counters = NewCounters}};
error ->
{error, {nodedown, <<"progress not possible">>}}
end;
handle_message({rexi_EXIT, Reason}, Shard, #pacc{} = Acc) ->
- #pacc{counters = Counters, ring_opts = RingOpts} = Acc,
+ #pacc{counters = Counters} = Acc,
NewCounters = fabric_dict:erase(Shard, Counters),
- case fabric_ring:is_progress_possible(NewCounters, RingOpts) of
+ case fabric_ring:is_progress_possible(NewCounters, [all]) of
true ->
{ok, Acc#pacc{counters = NewCounters}};
false ->
@@ -92,8 +90,7 @@ make_shards() ->
init_acc(Shards) ->
#pacc{
counters = fabric_dict:init(Shards, nil),
- replies = couch_util:new_set(),
- ring_opts = [{any, Shards}]
+ replies = couch_util:new_set()
}.
first_result_ok_test() ->