summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2021-11-27 17:26:17 -0500
committerAdam Kocoloski <kocolosk@apache.org>2021-12-01 17:24:05 -0500
commitf801d400bd880644e74098070da82b5703ff0477 (patch)
treed6b89bbfac9e5eaf977428c75b9abcaa7ee7b6d0
parent9391bf0c0514dd81d2e0ea4d69b03cb1e2760606 (diff)
downloadcouchdb-f801d400bd880644e74098070da82b5703ff0477.tar.gz
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.
-rw-r--r--src/ddoc_cache/src/ddoc_cache_lru.erl6
1 files 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 10b4aa0f0..ec8f5caaa 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{