summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2017-10-10 12:28:55 -0500
committerPaul J. Davis <paul.joseph.davis@gmail.com>2017-10-11 14:40:10 -0500
commit703e6c5c860276c40b960ed1c5d6be6b6086530b (patch)
tree94f24f23fd0ef8732fb6109f75224e395602b375
parenta99cc6fda04e35e2266953a73a182c724ed928de (diff)
downloadcouchdb-703e6c5c860276c40b960ed1c5d6be6b6086530b.tar.gz
Fix cluster upgrades when deploying ddoc_cache
As it turns out I made a bit of a mistake when I forgot that the old ddoc_cache implementation had an ets_lru process registered as ddoc_cache_lru. These cast messages were causing that process to crash. If a cluster had enough design document activity and enough nodes this would cause nodes with the old ddoc_cache implementation to reboot the entire VM. This was a cascading failure due to the ets_lru process restarting frequently enough that it brought down the entire ddoc_cache application.
-rw-r--r--src/ddoc_cache/src/ddoc_cache_lru.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ddoc_cache/src/ddoc_cache_lru.erl b/src/ddoc_cache/src/ddoc_cache_lru.erl
index 810cbef63..e94934d04 100644
--- a/src/ddoc_cache/src/ddoc_cache_lru.erl
+++ b/src/ddoc_cache/src/ddoc_cache_lru.erl
@@ -39,6 +39,9 @@
-include("ddoc_cache.hrl").
+-define(OPENER, ddoc_cache_opener).
+
+
-record(st, {
pids, % pid -> key
dbs, % dbname -> docid -> key -> pid
@@ -143,11 +146,11 @@ handle_call(Msg, _From, St) ->
handle_cast({evict, DbName}, St) ->
- gen_server:abcast(mem3:nodes(), ?MODULE, {do_evict, DbName}),
+ gen_server:abcast(mem3:nodes(), ?OPENER, {do_evict, DbName}),
{noreply, St};
handle_cast({refresh, DbName, DDocIds}, St) ->
- gen_server:abcast(mem3:nodes(), ?MODULE, {do_refresh, DbName, DDocIds}),
+ gen_server:abcast(mem3:nodes(), ?OPENER, {do_evict, DbName, DDocIds}),
{noreply, St};
handle_cast({do_evict, DbName}, St) ->