rnewson commented on PR #6071:
URL: https://github.com/apache/couchdb/pull/6071#issuecomment-5045376243
```erlang
diff --git i/src/fabric/src/fabric_doc_update.erl
w/src/fabric/src/fabric_doc_update.erl
index 70081af73..cec747b67 100644
--- i/src/fabric/src/fabric_doc_update.erl
+++ w/src/fabric/src/fabric_doc_update.erl
@@ -103,8 +103,8 @@ handle_message(internal_server_error, Worker, #acc{} =
Acc0) ->
#acc{waiting_count = WC, grouped_docs = GrpDocs} = Acc0,
NewGrpDocs = lists:keydelete(Worker, 1, GrpDocs),
skip_message(start_workers(Acc0#acc{waiting_count = WC - 1,
grouped_docs = NewGrpDocs}));
-handle_message(attachment_chunk_received, _Worker, #acc{} = Acc0) ->
- {ok, Acc0};
+handle_message(attachment_chunk_received, Worker, #acc{} = Acc0) ->
+ {ok, start_workers_for_range(Worker#shard.range, Acc0)};
handle_message({ok, Replies}, Worker, #acc{} = Acc0) ->
#acc{
waiting_count = WaitingCount,
@@ -470,6 +470,20 @@ start_remaining_workers(#acc{} = Acc) ->
Acc#acc.grouped_docs
).
+start_workers_for_range(Range, #acc{} = Acc) ->
+ lists:foldl(
+ fun({Worker, Docs}, AccIn) ->
+ if
+ Worker#shard.range == Range ->
+ start_worker(Worker, Docs, AccIn);
+ true ->
+ AccIn
+ end
+ end,
+ Acc,
+ Acc#acc.grouped_docs
+ ).
+
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]