nickva commented on issue #5980:
URL: https://github.com/apache/couchdb/issues/5980#issuecomment-4314993570

   An apparent simple approach on how to handle it might be to start 
broadcasting the ddoc_updated events from each couch_db_updater processes to 
other nodes as well. But this isn't as simple as it seems, since in 
`handle_db_event`callbacks we currently assume we can open the the changed 
design document ID which got updated. If we send the event to other nodes that 
won't be the case, as the design document just won't "live" there. To do it 
properly, I think we'd have to switch the `couch_db :open_doc` call with a 
`fabric:open_doc`, but with a sharded index server (one per cpu) and multiple 
nodes this can add up across a cluster (we should use ddoc_cache probably here).
   
   Another observation is that ken and ddoc cache already to their own 
individual casts to other nodes. That's how indexes start building on other 
nodes and how ddoc_cache gets refreshed.
   
   
https://github.com/apache/couchdb/blob/f7cb246cd54c2518a40df00e74b85996664a0402/src/ken/src/ken_server.erl#L75-L78
   
   
https://github.com/apache/couchdb/blob/f7cb246cd54c2518a40df00e74b85996664a0402/src/ddoc_cache/src/ddoc_cache_lru.erl#L133-L135
   
   So while everyone is doing "their own thing" index cleanup fell through the 
cracks.


-- 
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]

Reply via email to