pgj commented on PR #4958:
URL: https://github.com/apache/couchdb/pull/4958#issuecomment-1914662730

   > I was mainly suggesting a way to have a bound on the uncertainty in the 
stats, if it the increase in messages is a problem.
   
   @nickva I am afraid we cannot allow any uncertainty in the statistics if 
downstream consumers wanted to build uses cases on top of this mechanism that 
involves billing.
   
   > I don't know if it's a performance issue, I think you and @chewbranca did 
some measurements?
   
   @chewbranca might have some performance results on his side, but I have not 
collected any myself.  Probably I should do some just for curiosity and for 
including here.
   
   > From what I remember in mango the issue was happening when we have a 
`limit` specified?
   
   Yes, but if I recall correctly there is always a limit assigned for the 
`_find` requests.  I believe the emphasis is on the relative distance of the 
limit and the number of results returned.  It is technically a result of a race 
condition: if the `stop` signal arrives at the wrong time, either the 
`completed` message is not emitted or it is not handled in the time.
   
   > Ideally we would wait for all workers to return their final message 
(perhaps as their exit reason as already noted), but without forcing the user 
to wait for more responses than are needed to form a complete response (i.e, 
the first response from each shard range).
   
   This can be done easily: replace the `stop` for an `ok` in 
`mango_cursor_view:handle_doc/2`.  Actually, this is also case that could be 
tested for performance.  Maybe it is not that expensive and sending the stats 
for every row.
   
   > Put simply, it was not anticipated that we would care about the other 
workers when this was built, the code fires off the jobs and wants to return as 
soon as it can, killing the remaining processes. A good fix here should tackle 
that directly.
   
   @rnewson do you have any pointers or ideas where to start with this?  In the 
previous discussions, you had [some 
suggestions](https://github.com/apache/couchdb/pull/4735#issuecomment-1715743087),
 but I could not make them work.
   
   


-- 
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: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to