summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2019-09-11 13:59:22 -0400
committerGitHub <noreply@github.com>2019-09-11 13:59:22 -0400
commit7f78e3025a7a1e5a3f708e422638d1cd9d9611ab (patch)
tree5447de6482f19dc7a13282202399b0bbcb16a064
parent7e0cc2163e9a00a617bef368b72d264e13417bca (diff)
parente746d9027f82bfe394cb95c6b2fad09df43fcca9 (diff)
downloadcouchdb-7f78e3025a7a1e5a3f708e422638d1cd9d9611ab.tar.gz
Merge branch 'master' into remove-old-multiquery
-rwxr-xr-xdev/run16
-rw-r--r--src/chttpd/src/chttpd_auth_cache.erl3
-rw-r--r--src/fabric/src/fabric.erl7
3 files changed, 24 insertions, 2 deletions
diff --git a/dev/run b/dev/run
index 10351eb86..9209c1129 100755
--- a/dev/run
+++ b/dev/run
@@ -110,6 +110,11 @@ def setup_logging(ctx):
def setup_argparse():
+ parser = get_args_parser()
+ return parser.parse_args()
+
+
+def get_args_parser():
parser = optparse.OptionParser(description="Runs CouchDB 2.0 dev cluster")
parser.add_option(
"-a",
@@ -200,7 +205,13 @@ def setup_argparse():
action="store_true",
help="Select available ports for nodes automatically",
)
- return parser.parse_args()
+ parser.add_option(
+ "--extra_args",
+ dest="extra_args",
+ default=None,
+ help="Extra arguments to pass to beam process",
+ )
+ return parser
def setup_context(opts, args):
@@ -223,6 +234,7 @@ def setup_context(opts, args):
"haproxy_port": opts.haproxy_port,
"config_overrides": opts.config_overrides,
"no_eval": opts.no_eval,
+ "extra_args": opts.extra_args,
"reset_logs": True,
"procs": [],
"auto_ports": opts.auto_ports,
@@ -578,6 +590,8 @@ def boot_node(ctx, node):
mode = "r+b"
logfname = os.path.join(ctx["devdir"], "logs", "%s.log" % node)
log = open(logfname, mode)
+ if "extra_args" in ctx and ctx["extra_args"]:
+ cmd += ctx["extra_args"].split(" ")
cmd = [toposixpath(x) for x in cmd]
return sp.Popen(cmd, stdin=sp.PIPE, stdout=log, stderr=sp.STDOUT, env=env)
diff --git a/src/chttpd/src/chttpd_auth_cache.erl b/src/chttpd/src/chttpd_auth_cache.erl
index 638d8c748..fdae27b79 100644
--- a/src/chttpd/src/chttpd_auth_cache.erl
+++ b/src/chttpd/src/chttpd_auth_cache.erl
@@ -113,6 +113,9 @@ handle_info({'DOWN', _, _, Pid, Reason}, #state{changes_pid=Pid} = State) ->
Seq = case Reason of
{seq, EndSeq} ->
EndSeq;
+ {database_does_not_exist, _} ->
+ couch_log:notice("~p changes listener died because the _users database does not exist. Create the database to silence this notice.", [?MODULE]),
+ 0;
_ ->
couch_log:notice("~p changes listener died ~r", [?MODULE, Reason]),
0
diff --git a/src/fabric/src/fabric.erl b/src/fabric/src/fabric.erl
index d98ffc978..27fa8c045 100644
--- a/src/fabric/src/fabric.erl
+++ b/src/fabric/src/fabric.erl
@@ -524,8 +524,11 @@ inactive_index_files(DbName) ->
end, mem3:local_shards(dbname(DbName))),
if ActiveSigs =:= [] -> FileList; true ->
+ %% <sig>.view and <sig>.compact.view where <sig> is in ActiveSigs
+ %% will be excluded from FileList because they are active view
+ %% files and should not be deleted.
lists:filter(fun(FilePath) ->
- not maps:is_key(filename:basename(FilePath, ".view"), ActiveSigs)
+ not maps:is_key(get_view_sig_from_filename(FilePath), ActiveSigs)
end, FileList)
end.
@@ -662,6 +665,8 @@ kl_to_record(KeyList,RecName) ->
set_namespace(NS, #mrargs{extra = Extra} = Args) ->
Args#mrargs{extra = [{namespace, NS} | Extra]}.
+get_view_sig_from_filename(FilePath) ->
+ filename:basename(filename:basename(FilePath, ".view"), ".compact").
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").