You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2021/12/01 22:24:12 UTC

[couchdb] 01/02: Avoid routing events through ddoc_cache_opener

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit f801d400bd880644e74098070da82b5703ff0477
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sat Nov 27 17:26:17 2021 -0500

    Avoid routing events through ddoc_cache_opener
    
    This flow was presumably in place for some cluster upgrade scenarios
    several years ago, and no one ever completed the work to finalize the
    event flow. All the ddoc_cache_opener process does at this point is
    forward the event back to ddoc_cache_lru, so let's just send that
    message directly and remove the superfluous gen_server.
---
 src/ddoc_cache/src/ddoc_cache_lru.erl | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/ddoc_cache/src/ddoc_cache_lru.erl b/src/ddoc_cache/src/ddoc_cache_lru.erl
index 10b4aa0..ec8f5ca 100644
--- a/src/ddoc_cache/src/ddoc_cache_lru.erl
+++ b/src/ddoc_cache/src/ddoc_cache_lru.erl
@@ -36,8 +36,6 @@
 
 -include("ddoc_cache.hrl").
 
--define(OPENER, ddoc_cache_opener).
-
 -record(st, {
     % pid -> key
     pids,
@@ -138,10 +136,10 @@ handle_call(Msg, _From, St) ->
     {stop, {invalid_call, Msg}, {invalid_call, Msg}, St}.
 
 handle_cast({evict, DbName}, St) ->
-    gen_server:abcast(mem3:nodes(), ?OPENER, {do_evict, DbName}),
+    gen_server:abcast(mem3:nodes(), ?MODULE, {do_evict, DbName}),
     {noreply, St};
 handle_cast({refresh, DbName, DDocIds}, St) ->
-    gen_server:abcast(mem3:nodes(), ?OPENER, {do_evict, DbName, DDocIds}),
+    gen_server:abcast(mem3:nodes(), ?MODULE, {do_refresh, DbName, DDocIds}),
     {noreply, St};
 handle_cast({do_evict, DbName}, St) ->
     #st{