summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2017-10-10 12:28:55 -0500
committerJoan Touzet <wohali@users.noreply.github.com>2017-10-19 19:13:25 -0400
commit9f305711f310f206fe9b806b8623cd6bcfaaa1e8 (patch)
tree94f24f23fd0ef8732fb6109f75224e395602b375
parent74a29677d5c1af0e381d3fc4a6ad91ff6f0bc6f7 (diff)
downloadcouchdb-9f305711f310f206fe9b806b8623cd6bcfaaa1e8.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) ->