summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2020-03-21 20:00:17 -0400
committerNick Vatamaniuc <vatamane@apache.org>2020-03-21 20:15:53 -0400
commit9c8d3fd3bf5efd5a72121560dac6e319b59f524e (patch)
treed8f131a48ca5896ac9bbe03face26b867831a3a0
parenta008c6d0b5da269d519bd2a6ef3aa6e9aa22abc2 (diff)
downloadcouchdb-fix-couch-jobs.tar.gz
Fix couch_jobs after recent db re-creation commitfix-couch-jobs
The e520294c7ee3f55c3e8cc7d528ff37a5a93c800f commit inadvertently changed the `fabric2_fdb:refresh/1` head matching to accept db instances with no names. `couch_jobs` uses those but they are not cached in fabric2_server. So here we return to the previous matching rule where contexts without names don't get refreshed from the cache.
-rw-r--r--src/fabric/src/fabric2_fdb.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fabric/src/fabric2_fdb.erl b/src/fabric/src/fabric2_fdb.erl
index 5c72a1726..f5f7bec83 100644
--- a/src/fabric/src/fabric2_fdb.erl
+++ b/src/fabric/src/fabric2_fdb.erl
@@ -288,9 +288,10 @@ open(#{} = Db0, Options) ->
load_validate_doc_funs(Db3).
-refresh(#{tx := undefined} = Db) ->
+% Match on `name` in the function head since some non-fabric2 db
+% objects might not have names and so they don't get cached
+refresh(#{tx := undefined, name := DbName} = Db) ->
#{
- name := DbName,
uuid := UUID,
md_version := OldVer
} = Db,