[couchdb] branch prometheus-endpoint2 created (now 1b3f254)

2021-01-25 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch prometheus-endpoint2
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 1b3f254  introduce prometheus endpoint

This branch includes the following new commits:

 new 1b3f254  introduce prometheus endpoint

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: introduce prometheus endpoint

2021-01-25 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch prometheus-endpoint2
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 1b3f2540aadfafe5aaf80b1e37fe172e33a841bc
Author: jiangph 
AuthorDate: Tue Jan 26 12:57:18 2021 +0800

introduce prometheus endpoint
---
 rebar.config.script |  3 ++-
 src/couch/src/couch.app.src |  3 ++-
 src/couch_stats/src/couch_stats.erl | 21 ++---
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/rebar.config.script b/rebar.config.script
index 4abdcc9..f3c526c 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -174,7 +174,8 @@ DepDescs = [
 {meck, "meck", {tag, "0.8.8"}},
 {recon,"recon",{tag, "2.5.0"}},
 {passage,  "passage",  {tag, "0.2.6"}},
-{thrift_protocol,  "thrift-protocol",  {tag, "0.1.5"}}
+{thrift_protocol,  "thrift-protocol",  {tag, "0.1.5"}},
+{prometheus,  "prometheus",  {tag, "master"}}
 ].
 
 WithProper = lists:keyfind(with_proper, 1, CouchConfig) == {with_proper, true}.
diff --git a/src/couch/src/couch.app.src b/src/couch/src/couch.app.src
index 6116c79..592b1a1 100644
--- a/src/couch/src/couch.app.src
+++ b/src/couch/src/couch.app.src
@@ -45,7 +45,8 @@
 couch_event,
 ioq,
 couch_stats,
-hyper
+hyper,
+prometheus
 ]},
 {env, [
 { httpd_global_handlers, [
diff --git a/src/couch_stats/src/couch_stats.erl 
b/src/couch_stats/src/couch_stats.erl
index 4fde14a..dfa7836 100644
--- a/src/couch_stats/src/couch_stats.erl
+++ b/src/couch_stats/src/couch_stats.erl
@@ -58,18 +58,33 @@ new(counter, Name) ->
 case folsom_metrics:new_counter(Name) of
 ok -> ok;
 {error, Name, metric_already_exists} -> {error, metric_exists}
-end;
+end,
+FlatName = lists:foldl(fun(NamePart, Acc) ->
+atom_to_list(NamePart) ++ "_"  ++  Acc
+end, "", Name),
+prometheus_counter:new([{name, list_to_atom(FlatName)}, {help, FlatName}]);
 new(histogram, Name) ->
 Time = config:get_integer("stats", "interval", ?DEFAULT_INTERVAL),
 case folsom_metrics:new_histogram(Name, slide_uniform, {Time, 1024}) of
 ok -> ok;
 {error, Name, metric_already_exists} -> {error, metric_exists}
-end;
+end,
+FlatName = lists:foldl(fun(NamePart, Acc) ->
+atom_to_list(NamePart) ++ "_"  ++  Acc
+end, "", Name),
+prometheus_histogram:new([{name, list_to_atom(FlatName)},
+{labels, [method]},
+{buckets, [50, 75, 90, 95, 99, 999]},
+{help, FlatName}]);
 new(gauge, Name) ->
 case folsom_metrics:new_gauge(Name) of
 ok -> ok;
 {error, Name, metric_already_exists} -> {error, metric_exists}
-end;
+end,
+FlatName = lists:foldl(fun(NamePart, Acc) ->
+atom_to_list(NamePart) ++ "_"  ++  Acc
+end, "", Name),
+prometheus_gauge:new([{name, list_to_atom(FlatName)}, {help, FlatName}]);
 new(_, _) ->
 {error, unsupported_type}.
 



[couchdb] 01/01: introduce prometheus endpoint

2020-12-03 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch prometheus-endpoint
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 7deab47e90da8aa5bade8a58393cd1709d05ee96
Author: jiangph 
AuthorDate: Thu Dec 3 20:41:36 2020 +0800

introduce prometheus endpoint
---
 src/chttpd/src/chttpd_node.erl | 102 +
 1 file changed, 102 insertions(+)

diff --git a/src/chttpd/src/chttpd_node.erl b/src/chttpd/src/chttpd_node.erl
index 6407df1..ce4c349 100644
--- a/src/chttpd/src/chttpd_node.erl
+++ b/src/chttpd/src/chttpd_node.erl
@@ -122,6 +122,23 @@ handle_node_req(#httpd{method='GET', path_parts=[_, Node, 
<<"_system">>]}=Req) -
 send_json(Req, EJSON);
 handle_node_req(#httpd{path_parts=[_, _Node, <<"_system">>]}=Req) ->
 send_method_not_allowed(Req, "GET");
+
+% GET /_node/$node/metrics
+handle_node_req(#httpd{method='GET', path_parts=[_, Node, <<"metrics">>]}=Req) 
->
+Stats = call_node(Node, chttpd_node, get_stats, []),
+EJSON = couch_stats_httpd:to_ejson(Stats),
+Headers = [{<<"Content-Type">>, <<"text/plain">>}],
+CouchDB = get_couchdb_stats(),
+%System = couch_stats_httpd:to_ejson(get_system_stats()),
+Body = to_bin(lists:map(fun(Line) ->
+io_lib:format("~s~n", [Line])
+end, CouchDB)),
+{ok, Resp} = chttpd:start_response_length(Req, 200, Headers, size(Body)),
+chttpd:send(Resp, Body);
+handle_node_req(#httpd{path_parts=[_, _Node, <<"metrics">>]}=Req) ->
+send_method_not_allowed(Req, "GET");
+
+
 % POST /_node/$node/_restart
 handle_node_req(#httpd{method='POST', path_parts=[_, Node, 
<<"_restart">>]}=Req) ->
 call_node(Node, init, restart, []),
@@ -298,3 +315,88 @@ run_queues() ->
 [DCQ | SQs] = lists:reverse(statistics(run_queue_lengths)),
 {lists:sum(SQs), DCQ}
 end.
+
+json_to_prom(SystemJson) ->
+SystemMap  = jiffy:decode(SystemJson, [return_maps]),
+SystemList = maps:to_list(SystemMap),
+ListA = lists:map(fun({Key, Value}) ->
+couch_to_prom(<<"couchdb">>, Key, Value)
+  end, SystemList),
+lists:flatten(ListA).
+
+couch_to_prom(Prefix, Key, Value) when is_map(Value) ->
+case maps:is_key(<<"value">>, Value) of
+false ->
+ValueList = maps:to_list(Value),
+Prefix1 =  list_to_binary(binary_to_list(Prefix) ++ "_" ++ 
binary_to_list(Key)),
+lists:foldl(fun({K, V}, Results0) ->
+NewResult = couch_to_prom(Prefix1, K, V),
+[NewResult | Results0]
+end, [], ValueList);
+true ->
+MV = maps:get(<<"value">>, Value),
+MD = maps:get(<<"desc">>, Value),
+Type = maps:get(<<"type">>, Value),
+to_prom(Prefix, Key, Type, MV)
+end;
+couch_to_prom(Prefix, Key, Value) ->
+to_prom(Prefix, Key, Value).
+
+to_prom(Prefix, Metric, Value) ->
+to_prom_list(Prefix, Metric, Value).
+
+to_prom(Prefix, Metric, <<"counter">>, Value) ->
+to_prom_list(Prefix, Metric, Value);
+to_prom(Prefix, Metric, <<"gauge">>, Value) ->
+to_prom_list(Prefix, Metric, Value);
+to_prom(Prefix, Metric, <<"histogram">>, Value) when is_map(Value)  ->
+maps:fold(fun (K, V, Acc) ->
+case K of
+<<"percentile">> ->
+PN = ?l2b(?b2l(Metric)  ++ "_percentile"),
+Quantiles = lists:map(fun([Perc, Val]) ->
+case Perc of
+50 -> to_prom_list(Prefix, PN, [{quantile, 
<<"0.5">>}], Val);
+75 -> to_prom_list(Prefix, PN, [{quantile, 
<<"0.75">>}], Val);
+90 -> to_prom_list(Prefix, PN, [{quantile, 
<<"0.9">>}], Val);
+95 -> to_prom_list(Prefix, PN, [{quantile, 
<<"0.95">>}], Val);
+99 -> to_prom_list(Prefix, PN, [{quantile, 
<<"0.99">>}], Val);
+999 -> to_prom_list(Prefix, PN, [{quantile, 
<<"0.999">>}], Val)
+end
+  end, V),
+[Quantiles, Acc];
+_ ->
+[to_prom_list(Prefix, ?l2b(?b2l(Metric) ++ "_" ++ K), V), Acc]
+end
+  end, [], Value).
+
+
+to_prom_list(Prefix, Metric, Value) ->
+[to_bin(io_lib:format(&q

[couchdb] branch prometheus-endpoint created (now 7deab47)

2020-12-03 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch prometheus-endpoint
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 7deab47  introduce prometheus endpoint

This branch includes the following new commits:

 new 7deab47  introduce prometheus endpoint

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] branch 3.x updated (fb91f37 -> 0746519)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from fb91f37  Merge pull request #3255 from 
apache/3.x-reset-corrupt-view-index-2
 add 59ae7ac  added $keyMapMatch Mango operator
 new 0746519  Merge pull request #3254 from 
apache/3.x-add-mango-operator-match-key-in-map

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/mango/src/mango_selector.erl   | 32 
 src/mango/test/03-operator-test.py |  9 +
 2 files changed, 41 insertions(+)



[couchdb] 01/01: Merge pull request #3254 from apache/3.x-add-mango-operator-match-key-in-map

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 07465195409c4aa9d855545130744bcdec864e37
Merge: fb91f37 59ae7ac
Author: Peng Hui Jiang 
AuthorDate: Tue Nov 10 11:14:17 2020 +0800

Merge pull request #3254 from apache/3.x-add-mango-operator-match-key-in-map

added $keyMapMatch Mango operator

 src/mango/src/mango_selector.erl   | 32 
 src/mango/test/03-operator-test.py |  9 +
 2 files changed, 41 insertions(+)



[couchdb] 01/01: Merge pull request #3254 from apache/3.x-add-mango-operator-match-key-in-map

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 07465195409c4aa9d855545130744bcdec864e37
Merge: fb91f37 59ae7ac
Author: Peng Hui Jiang 
AuthorDate: Tue Nov 10 11:14:17 2020 +0800

Merge pull request #3254 from apache/3.x-add-mango-operator-match-key-in-map

added $keyMapMatch Mango operator

 src/mango/src/mango_selector.erl   | 32 
 src/mango/test/03-operator-test.py |  9 +
 2 files changed, 41 insertions(+)



[couchdb] branch 3.x updated (fb91f37 -> 0746519)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from fb91f37  Merge pull request #3255 from 
apache/3.x-reset-corrupt-view-index-2
 add 59ae7ac  added $keyMapMatch Mango operator
 new 0746519  Merge pull request #3254 from 
apache/3.x-add-mango-operator-match-key-in-map

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/mango/src/mango_selector.erl   | 32 
 src/mango/test/03-operator-test.py |  9 +
 2 files changed, 41 insertions(+)



[couchdb] branch 3.x-add-mango-operator-match-key-in-map updated (5adfdd8 -> 59ae7ac)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-add-mango-operator-match-key-in-map
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 5adfdd8  added $keyMapMatch Mango operator
 add 59ae7ac  added $keyMapMatch Mango operator

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5adfdd8)
\
 N -- N -- N   refs/heads/3.x-add-mango-operator-match-key-in-map 
(59ae7ac)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch 3.x-add-mango-operator-match-key-in-map updated (5adfdd8 -> 59ae7ac)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-add-mango-operator-match-key-in-map
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 5adfdd8  added $keyMapMatch Mango operator
 add 59ae7ac  added $keyMapMatch Mango operator

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5adfdd8)
\
 N -- N -- N   refs/heads/3.x-add-mango-operator-match-key-in-map 
(59ae7ac)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch 3.x-add-mango-operator-match-key-in-map updated (4ed705f -> 5adfdd8)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-add-mango-operator-match-key-in-map
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 4ed705f  added $keyMapMatch Mango operator
 add 9d8ea31  Reset if we don't get a view header
 add fb91f37  Merge pull request #3255 from 
apache/3.x-reset-corrupt-view-index-2
 add 5adfdd8  added $keyMapMatch Mango operator

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (4ed705f)
\
 N -- N -- N   refs/heads/3.x-add-mango-operator-match-key-in-map 
(5adfdd8)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/couch_mrview/src/couch_mrview_index.erl | 6 ++
 1 file changed, 6 insertions(+)



[couchdb] branch 3.x updated (9a0c55b -> fb91f37)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 9a0c55b  Merge pull request #3253 from apache/check_local_dbs
 add 9d8ea31  Reset if we don't get a view header
 new fb91f37  Merge pull request #3255 from 
apache/3.x-reset-corrupt-view-index-2

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch_mrview/src/couch_mrview_index.erl | 6 ++
 1 file changed, 6 insertions(+)



[couchdb] 01/01: Merge pull request #3255 from apache/3.x-reset-corrupt-view-index-2

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit fb91f37b0e67c36aa2fb3f3001fcdcac1714da98
Merge: 9a0c55b 9d8ea31
Author: Peng Hui Jiang 
AuthorDate: Tue Nov 10 06:31:20 2020 +0800

Merge pull request #3255 from apache/3.x-reset-corrupt-view-index-2

Reset if we don't get a view header

 src/couch_mrview/src/couch_mrview_index.erl | 6 ++
 1 file changed, 6 insertions(+)



[couchdb] branch 3.x-add-mango-operator-match-key-in-map created (now 4ed705f)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-add-mango-operator-match-key-in-map
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 4ed705f  added $keyMapMatch Mango operator

No new revisions were added by this update.



[couchdb] branch 3.x-reset-corrupt-view-index-2 created (now 9d8ea31)

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-reset-corrupt-view-index-2
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 9d8ea31  Reset if we don't get a view header

This branch includes the following new commits:

 new 9d8ea31  Reset if we don't get a view header

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: Reset if we don't get a view header

2020-11-09 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x-reset-corrupt-view-index-2
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9d8ea3188c79a29929d38fa5dcf93b01029e5531
Author: Robert Newson 
AuthorDate: Sun Feb 16 12:05:29 2020 +

Reset if we don't get a view header

I found a .view file with a db_header in production (cause unknown but
I'm hoping it's manual intervention).

This patch means we'll reset the index if we find something other than
a view header when looking for one.
---
 src/couch_mrview/src/couch_mrview_index.erl | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/couch_mrview/src/couch_mrview_index.erl 
b/src/couch_mrview/src/couch_mrview_index.erl
index 018060f..68f1d23 100644
--- a/src/couch_mrview/src/couch_mrview_index.erl
+++ b/src/couch_mrview/src/couch_mrview_index.erl
@@ -133,6 +133,12 @@ open(Db, State0) ->
 NewSt = couch_mrview_util:reset_index(Db, Fd, State),
 ensure_local_purge_doc(Db, NewSt),
 {ok, NewSt};
+{ok, Else} ->
+couch_log:error("~s has a bad header: got ~p",
+[IndexFName, Else]),
+NewSt = couch_mrview_util:reset_index(Db, Fd, State),
+ensure_local_purge_doc(Db, NewSt),
+{ok, NewSt};
 no_valid_header ->
 NewSt = couch_mrview_util:reset_index(Db, Fd, State),
 ensure_local_purge_doc(Db, NewSt),



[couchdb] 01/01: Merge pull request #3253 from apache/check_local_dbs

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9a0c55be85852621c88b7ff166183b388987f57c
Merge: 94fec08 ff33084
Author: Peng Hui Jiang 
AuthorDate: Mon Nov 9 14:09:10 2020 +0800

Merge pull request #3253 from apache/check_local_dbs

fix check_local_dbs test

 src/mem3/test/eunit/mem3_seeds_test.erl | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)



[couchdb] branch 3.x updated (94fec08 -> 9a0c55b)

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 94fec08  Merge pull request #3252 from apache/port-json-decode-2
 add ff33084  fix check_local_dbs test
 new 9a0c55b  Merge pull request #3253 from apache/check_local_dbs

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/mem3/test/eunit/mem3_seeds_test.erl | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)



[couchdb] branch check_local_dbs updated (97702ff -> ff33084)

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch check_local_dbs
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 97702ff  fix check_local_dbs test
 add ff33084  fix check_local_dbs test

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (97702ff)
\
 N -- N -- N   refs/heads/check_local_dbs (ff33084)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] 01/01: fix check_local_dbs test

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch check_local_dbs
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 97702fff8cf839a15d7b8edec5e587240cb30248
Author: jiangph 
AuthorDate: Mon Nov 9 11:19:01 2020 +0800

fix check_local_dbs test
---
 src/mem3/test/eunit/mem3_seeds_test.erl | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mem3/test/eunit/mem3_seeds_test.erl 
b/src/mem3/test/eunit/mem3_seeds_test.erl
index ac32282..1c1e2fe 100644
--- a/src/mem3/test/eunit/mem3_seeds_test.erl
+++ b/src/mem3/test/eunit/mem3_seeds_test.erl
@@ -59,11 +59,10 @@ check_nodelist() ->
 end.
 
 check_local_dbs() ->
-?assertEqual([<<"_dbs">>, <<"_nodes">>],
-lists:sort(mem3_sync:local_dbs())),
+LocalDbs = mem3_sync:local_dbs(),
 {ok, _} = couch_server:create(<<"_users">>, []),
-?assertEqual([<<"_dbs">>, <<"_nodes">>, <<"_users">>],
-lists:sort(mem3_sync:local_dbs())).
+?assertEqual(lists:append(LocalDbs, [<<"_users">>]),
+mem3_sync:local_dbs()).
 
 cleanup() ->
 application:stop(mem3),



[couchdb] branch check_local_dbs created (now 97702ff)

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch check_local_dbs
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 97702ff  fix check_local_dbs test

This branch includes the following new commits:

 new 97702ff  fix check_local_dbs test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: ignore mem3 test

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch ignore-mem3-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3d660b4094488bf548f0cfc8cb263eecac226166
Author: jiangph 
AuthorDate: Sun Nov 8 09:40:29 2020 +0800

ignore mem3 test
---
 src/mem3/test/eunit/mem3_seeds_test.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mem3/test/eunit/mem3_seeds_test.erl 
b/src/mem3/test/eunit/mem3_seeds_test.erl
index ac32282..c93fff4 100644
--- a/src/mem3/test/eunit/mem3_seeds_test.erl
+++ b/src/mem3/test/eunit/mem3_seeds_test.erl
@@ -18,8 +18,8 @@ a_test_() ->
 Tests = [
 {"empty seedlist should set status ok", fun 
empty_seedlist_status_ok/0},
 {"all seedlist nodes unreachable keeps status seeding", fun 
seedlist_misconfiguration/0},
-{"seedlist entries should be present in _nodes", fun check_nodelist/0},
-{"optional local _users db in mem3_sync:local_dbs()", fun 
check_local_dbs/0}
+{"seedlist entries should be present in _nodes", fun check_nodelist/0}
+%{"optional local _users db in mem3_sync:local_dbs()", fun 
check_local_dbs/0}
 ],
 {setup, fun setup/0, fun teardown/1, Tests}.
 



[couchdb] branch ignore-mem3-test updated (86b0351 -> 3d660b4)

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch ignore-mem3-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 86b0351  ignore mem3 test
 add c5b5efb  Expose `couch_util:decode/2` to support jiffy options
 add 94fec08  Merge pull request #3252 from apache/port-json-decode-2
 new 3d660b4  ignore mem3 test

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (86b0351)
\
 N -- N -- N   refs/heads/ignore-mem3-test (3d660b4)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/src/couch_util.erl  | 7 +--
 src/couch/test/eunit/couch_util_tests.erl | 7 +++
 2 files changed, 12 insertions(+), 2 deletions(-)



[couchdb] branch 3.x updated (c563243 -> 94fec08)

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from c563243  Merge pull request #3250 from 
apache/3.x-re-monitor-compaction-pid
 add c5b5efb  Expose `couch_util:decode/2` to support jiffy options
 new 94fec08  Merge pull request #3252 from apache/port-json-decode-2

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/src/couch_util.erl  | 7 +--
 src/couch/test/eunit/couch_util_tests.erl | 7 +++
 2 files changed, 12 insertions(+), 2 deletions(-)



[couchdb] 01/01: Merge pull request #3252 from apache/port-json-decode-2

2020-11-08 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 94fec089529a420e693e7c0f54d179b179013293
Merge: c563243 c5b5efb
Author: Peng Hui Jiang 
AuthorDate: Mon Nov 9 10:01:17 2020 +0800

Merge pull request #3252 from apache/port-json-decode-2

Expose `couch_util:json_decode/2` to support jiffy options

 src/couch/src/couch_util.erl  | 7 +--
 src/couch/test/eunit/couch_util_tests.erl | 7 +++
 2 files changed, 12 insertions(+), 2 deletions(-)



[couchdb] branch ignore-mem3-test created (now 86b0351)

2020-11-07 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch ignore-mem3-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 86b0351  ignore mem3 test

This branch includes the following new commits:

 new 86b0351  ignore mem3 test

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: ignore mem3 test

2020-11-07 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch ignore-mem3-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 86b035148d8b385ef6c28f2de03b7fce47d8becc
Author: jiangph 
AuthorDate: Sun Nov 8 09:40:29 2020 +0800

ignore mem3 test
---
 src/mem3/test/eunit/mem3_seeds_test.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mem3/test/eunit/mem3_seeds_test.erl 
b/src/mem3/test/eunit/mem3_seeds_test.erl
index ac32282..c93fff4 100644
--- a/src/mem3/test/eunit/mem3_seeds_test.erl
+++ b/src/mem3/test/eunit/mem3_seeds_test.erl
@@ -18,8 +18,8 @@ a_test_() ->
 Tests = [
 {"empty seedlist should set status ok", fun 
empty_seedlist_status_ok/0},
 {"all seedlist nodes unreachable keeps status seeding", fun 
seedlist_misconfiguration/0},
-{"seedlist entries should be present in _nodes", fun check_nodelist/0},
-{"optional local _users db in mem3_sync:local_dbs()", fun 
check_local_dbs/0}
+{"seedlist entries should be present in _nodes", fun check_nodelist/0}
+%{"optional local _users db in mem3_sync:local_dbs()", fun 
check_local_dbs/0}
 ],
 {setup, fun setup/0, fun teardown/1, Tests}.
 



[couchdb] branch 3.x updated (3c8490e -> c563243)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 3c8490e  Merge pull request #3249 from 
apache/changes_filter_all_docs_oom_3.x
 add 0a66d5b  add remonitor code to DOWN message (#3144)
 add ca9df69  fix race condition (#3150)
 new c563243  Merge pull request #3250 from 
apache/3.x-re-monitor-compaction-pid

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/src/couch_db.erl|  9 +
 src/smoosh/src/smoosh_channel.erl | 31 +--
 2 files changed, 34 insertions(+), 6 deletions(-)



[couchdb] 01/01: Merge pull request #3250 from apache/3.x-re-monitor-compaction-pid

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit c563243e49548aff7c551484f3713f948a8d8a75
Merge: 3c8490e ca9df69
Author: Peng Hui Jiang 
AuthorDate: Sat Nov 7 09:20:27 2020 +0800

Merge pull request #3250 from apache/3.x-re-monitor-compaction-pid

3.x porting - add remonitor code to DOWN message (#3144)

 src/couch/src/couch_db.erl|  9 +
 src/smoosh/src/smoosh_channel.erl | 31 +--
 2 files changed, 34 insertions(+), 6 deletions(-)



[couchdb] branch 3.x-re-monitor-compaction-pid updated (eff0f2c -> ca9df69)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-re-monitor-compaction-pid
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard eff0f2c  fix race condition (#3150)
 discard 1db4705  add remonitor code to DOWN message (#3144)
 add 0678742  Retry filter_docs sequentially if the patch exceeds couchjs 
stack
 add 1218c53  Add test for splitting filter batches
 add 3c8490e  Merge pull request #3249 from 
apache/changes_filter_all_docs_oom_3.x
 add 0a66d5b  add remonitor code to DOWN message (#3144)
 add ca9df69  fix race condition (#3150)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (eff0f2c)
\
 N -- N -- N   refs/heads/3.x-re-monitor-compaction-pid (ca9df69)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/couch/src/couch_query_servers.erl  | 14 +-
 src/couch/test/eunit/couch_query_servers_tests.erl | 55 ++
 2 files changed, 68 insertions(+), 1 deletion(-)



[couchdb] branch 3.x-re-monitor-compaction-pid updated (1949934 -> eff0f2c)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-re-monitor-compaction-pid
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 1949934  convert erlfdb_error 2101 to transaction_too_large
 discard 19d0e74  fix race condition (#3150)
 add eff0f2c  fix race condition (#3150)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1949934)
\
 N -- N -- N   refs/heads/3.x-re-monitor-compaction-pid (eff0f2c)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/chttpd/src/chttpd.erl   |  5 -
 test/elixir/test/bulk_docs_test.exs | 18 --
 2 files changed, 23 deletions(-)



[couchdb] branch 3.x-re-monitor-compaction-pid updated (d8adb9b -> 1949934)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-re-monitor-compaction-pid
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard d8adb9b  fix race condition (#3150)
 add 19d0e74  fix race condition (#3150)
 add 1949934  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d8adb9b)
\
 N -- N -- N   refs/heads/3.x-re-monitor-compaction-pid (1949934)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/chttpd/src/chttpd.erl   |  5 +
 test/elixir/test/bulk_docs_test.exs | 18 ++
 2 files changed, 23 insertions(+)



[couchdb] branch 3.x-re-monitor-compaction-pid updated (1db4705 -> d8adb9b)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-re-monitor-compaction-pid
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 1db4705  add remonitor code to DOWN message (#3144)
 add d8adb9b  fix race condition (#3150)

No new revisions were added by this update.

Summary of changes:
 src/couch/src/couch_db.erl| 9 +
 src/smoosh/src/smoosh_channel.erl | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)



[couchdb] 01/01: fix race condition (#3150)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x-fix-compaction-race-condition
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit db872d0a2be7f5915c0dfba43db2914fdc501811
Author: Tony Sun 
AuthorDate: Mon Sep 14 11:12:47 2020 -0700

fix race condition (#3150)

This fixes a94e693f32672e4613bce0d80d0b9660f85275ea because a race
condition exisited where the 'DOWN' message could be received
before the compactor pid is spawned. Adding a synchronous call to
get the compactor pid guarantees that the couch_db_updater process
handling of finish_compaction has occurred.
---
 src/couch/src/couch_db.erl| 9 +
 src/smoosh/src/smoosh_channel.erl | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/couch/src/couch_db.erl b/src/couch/src/couch_db.erl
index e1d726d..390a198 100644
--- a/src/couch/src/couch_db.erl
+++ b/src/couch/src/couch_db.erl
@@ -37,6 +37,7 @@
 get_committed_update_seq/1,
 get_compacted_seq/1,
 get_compactor_pid/1,
+get_compactor_pid_sync/1,
 get_db_info/1,
 get_partition_info/2,
 get_del_doc_count/1,
@@ -572,6 +573,14 @@ get_compacted_seq(#db{}=Db) ->
 get_compactor_pid(#db{compactor_pid = Pid}) ->
 Pid.
 
+get_compactor_pid_sync(#db{main_pid=Pid}=Db) ->
+case gen_server:call(Pid, compactor_pid, infinity) of
+CPid when is_pid(CPid) ->
+CPid;
+_ ->
+nil
+end.
+
 get_db_info(Db) ->
 #db{
 name = Name,
diff --git a/src/smoosh/src/smoosh_channel.erl 
b/src/smoosh/src/smoosh_channel.erl
index d8a8d14..058f551 100644
--- a/src/smoosh/src/smoosh_channel.erl
+++ b/src/smoosh/src/smoosh_channel.erl
@@ -276,7 +276,7 @@ start_compact(State, Db) ->
 false ->
 DbPid = couch_db:get_pid(Db),
 Key = couch_db:name(Db),
-case couch_db:get_compactor_pid(Db) of
+case couch_db:get_compactor_pid_sync(Db) of
 nil ->
 Ref = erlang:monitor(process, DbPid),
 DbPid ! {'$gen_call', {self(), Ref}, start_compact},



[couchdb] branch 3.x-fix-compaction-race-condition created (now db872d0)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-fix-compaction-race-condition
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at db872d0  fix race condition (#3150)

This branch includes the following new commits:

 new db872d0  fix race condition (#3150)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] branch 3.x-re-monitor-compaction-pid created (now 1db4705)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x-re-monitor-compaction-pid
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 1db4705  add remonitor code to DOWN message (#3144)

This branch includes the following new commits:

 new 1db4705  add remonitor code to DOWN message (#3144)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: add remonitor code to DOWN message (#3144)

2020-11-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x-re-monitor-compaction-pid
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 1db47052c84246e729f89db781365b99835edf58
Author: Tony Sun 
AuthorDate: Thu Sep 10 13:35:17 2020 -0700

add remonitor code to DOWN message (#3144)

Smoosh monitors the compactor pid to determine when the compaction jobs
finishes, and uses this for its idea of concurrency. However, this isn't
accurate in the case where the compaction job has to re-spawn to catch up on
intervening changes since the same logical compaction job continues with
another pid and smoosh is not aware. In such cases, a smoosh channel with
concurrency one can start arbitrarily many additional database compaction 
jobs.

To solve this problem, we added a check to see if a compaction PID exists 
for
a db in `start_compact`. But wee need to add another check because this 
check
is only for shard that comes off the queue. So the following can still 
occur:

1. Enqueue a bunch of stuff into channel with concurrency 1
2. Begin highest priority job, Shard1, in channel
3. Compaction finishes, discovers compaction file is behind main file
4. Smoosh-monitored PID for Shard1 exits, a new one starts to finish the job
5. Smoosh receives the 'DOWN' message, begins the next highest priority job,
Shard2
6. Channel concurrency is now 2, not 1

This change adds another check into the 'DOWN' message so that it checks for
that specific shard. If the compaction PID exists then it means a new 
process
was spawned and we just monitor that one and add it back to the queue. The
length of the queue does not change and therefore we won’t spawn new
compaction jobs.
---
 src/smoosh/src/smoosh_channel.erl | 31 +--
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/smoosh/src/smoosh_channel.erl 
b/src/smoosh/src/smoosh_channel.erl
index d8a8d14..2a45c17 100644
--- a/src/smoosh/src/smoosh_channel.erl
+++ b/src/smoosh/src/smoosh_channel.erl
@@ -122,10 +122,9 @@ handle_info({'DOWN', Ref, _, Job, Reason}, State0) ->
 #state{active=Active0, starting=Starting0} = State,
 case lists:keytake(Job, 2, Active0) of
 {value, {Key, _Pid}, Active1} ->
-couch_log:warning("exit for compaction of ~p: ~p", [
-smoosh_utils:stringify(Key), Reason]),
-{ok, _} = timer:apply_after(5000, smoosh_server, enqueue, [Key]),
-{noreply, maybe_start_compaction(State#state{active=Active1})};
+State1 = maybe_remonitor_cpid(State#state{active=Active1}, Key,
+Reason),
+{noreply, maybe_start_compaction(State1)};
 false ->
 case lists:keytake(Ref, 1, Starting0) of
 {value, {_, Key}, Starting1} ->
@@ -281,8 +280,7 @@ start_compact(State, Db) ->
 Ref = erlang:monitor(process, DbPid),
 DbPid ! {'$gen_call', {self(), Ref}, start_compact},
 State#state{starting=[{Ref, Key}|State#state.starting]};
-% database is still compacting so we can just monitor the existing
-% compaction pid
+% Compaction is already running, so monitor existing compaction 
pid.
 CPid ->
 couch_log:notice("Db ~s continuing compaction",
 [smoosh_utils:stringify(Key)]),
@@ -293,6 +291,27 @@ start_compact(State, Db) ->
 false
 end.
 
+maybe_remonitor_cpid(State, DbName, Reason) when is_binary(DbName) ->
+{ok, Db} = couch_db:open_int(DbName, []),
+case couch_db:get_compactor_pid(Db) of
+nil ->
+couch_log:warning("exit for compaction of ~p: ~p",
+[smoosh_utils:stringify(DbName), Reason]),
+{ok, _} = timer:apply_after(5000, smoosh_server, enqueue, 
[DbName]),
+State;
+CPid ->
+couch_log:notice("~s compaction already running. Re-monitor Pid 
~p",
+[smoosh_utils:stringify(DbName), CPid]),
+erlang:monitor(process, CPid),
+State#state{active=[{DbName, CPid}|State#state.active]}
+end;
+% not a database compaction, so ignore the pid check
+maybe_remonitor_cpid(State, Key, Reason) ->
+couch_log:warning("exit for compaction of ~p: ~p",
+[smoosh_utils:stringify(Key), Reason]),
+{ok, _} = timer:apply_after(5000, smoosh_server, enqueue, [Key]),
+State.
+
 schedule_unpause() ->
 WaitSecs = list_to_integer(config:get("smoosh", "wait_secs", "30")),
 erlang:send_after(WaitSecs * 1000, self(), unpause).



[couchdb] branch main updated: convert erlfdb_error 2101 to transaction_too_large (#3222)

2020-10-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
 new ab70b75  convert erlfdb_error 2101 to transaction_too_large (#3222)
ab70b75 is described below

commit ab70b753b77804ab3bedf13d1cdbfc5692235d55
Author: Peng Hui Jiang 
AuthorDate: Wed Oct 21 11:14:57 2020 +0800

convert erlfdb_error 2101 to transaction_too_large (#3222)
---
 src/chttpd/src/chttpd.erl   |  5 +
 test/elixir/test/bulk_docs_test.exs | 18 ++
 2 files changed, 23 insertions(+)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 3100694..dc9a30f 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -362,6 +362,8 @@ catch_error(HttpReq, error, decryption_failed) ->
 send_error(HttpReq, decryption_failed);
 catch_error(HttpReq, error, not_ciphertext) ->
 send_error(HttpReq, not_ciphertext);
+catch_error(HttpReq, error, {erlfdb_error, 2101}) ->
+send_error(HttpReq, transaction_too_large);
 catch_error(HttpReq, Tag, Error) ->
 Stack = erlang:get_stacktrace(),
 % TODO improve logging and metrics collection for client disconnects
@@ -1009,6 +1011,9 @@ error_info({request_entity_too_large, {bulk_get, Max}}) 
when is_integer(Max) ->
 {413, <<"max_bulk_get_count_exceeded">>, integer_to_binary(Max)};
 error_info({request_entity_too_large, DocID}) ->
 {413, <<"document_too_large">>, DocID};
+error_info(transaction_too_large) ->
+{413, <<"transaction_too_large">>,
+<<"The request transaction is larger than 10MB" >>};
 error_info({error, security_migration_updates_disabled}) ->
 {503, <<"security_migration">>, <<"Updates to security docs are disabled 
during "
 "security migration.">>};
diff --git a/test/elixir/test/bulk_docs_test.exs 
b/test/elixir/test/bulk_docs_test.exs
index cbbc533..41690fe 100644
--- a/test/elixir/test/bulk_docs_test.exs
+++ b/test/elixir/test/bulk_docs_test.exs
@@ -130,6 +130,17 @@ defmodule BulkDocsTest do
 assert Enum.at(rows, 2)["error"] == "conflict"
   end
 
+  @tag :with_db
+  test "bulk docs raises transaction_too_large error for transaction larger 
than 10MB", ctx do
+docs = [%{_id: "0", a: random_string(16_000_000)}]
+old_size = 
Couch.get("/_node/node1@127.0.0.1/_config/couchdb/max_document_size").body
+set_config_raw("couchdb", "max_document_size", "67108864") # 64M
+resp = Couch.post("/#{ctx[:db_name]}/_bulk_docs", body: %{docs: docs})
+set_config_raw("couchdb", "max_document_size", old_size) # set back
+assert resp.status_code == 413
+assert resp.body["error"] == "transaction_too_large"
+  end
+
   defp bulk_post(docs, db) do
 retry_until(fn ->
   resp = Couch.post("/#{db}/_bulk_docs", body: %{docs: docs})
@@ -152,4 +163,11 @@ defmodule BulkDocsTest do
 assert resp.body["error"] == "bad_request"
 assert resp.body["reason"] == reason
   end
+
+  defp random_string(length) do
+raw = :crypto.strong_rand_bytes(length)
+raw
+|> Base.url_encode64
+|> binary_part(0, length)
+  end
 end



[couchdb] branch transaction_too_large-main created (now 5d8f9f6)

2020-10-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large-main
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 5d8f9f6  convert erlfdb_error 2101 to transaction_too_large

This branch includes the following new commits:

 new 5d8f9f6  convert erlfdb_error 2101 to transaction_too_large

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: convert erlfdb_error 2101 to transaction_too_large

2020-10-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch transaction_too_large-main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 5d8f9f61b8b17fce4ed4b5572a1d40065d3b5b14
Author: jiangph 
AuthorDate: Tue Oct 13 10:55:21 2020 +0800

convert erlfdb_error 2101 to transaction_too_large
---
 src/chttpd/src/chttpd.erl   |  5 +
 test/elixir/test/bulk_docs_test.exs | 18 ++
 2 files changed, 23 insertions(+)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 3100694..dc9a30f 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -362,6 +362,8 @@ catch_error(HttpReq, error, decryption_failed) ->
 send_error(HttpReq, decryption_failed);
 catch_error(HttpReq, error, not_ciphertext) ->
 send_error(HttpReq, not_ciphertext);
+catch_error(HttpReq, error, {erlfdb_error, 2101}) ->
+send_error(HttpReq, transaction_too_large);
 catch_error(HttpReq, Tag, Error) ->
 Stack = erlang:get_stacktrace(),
 % TODO improve logging and metrics collection for client disconnects
@@ -1009,6 +1011,9 @@ error_info({request_entity_too_large, {bulk_get, Max}}) 
when is_integer(Max) ->
 {413, <<"max_bulk_get_count_exceeded">>, integer_to_binary(Max)};
 error_info({request_entity_too_large, DocID}) ->
 {413, <<"document_too_large">>, DocID};
+error_info(transaction_too_large) ->
+{413, <<"transaction_too_large">>,
+<<"The request transaction is larger than 10MB" >>};
 error_info({error, security_migration_updates_disabled}) ->
 {503, <<"security_migration">>, <<"Updates to security docs are disabled 
during "
 "security migration.">>};
diff --git a/test/elixir/test/bulk_docs_test.exs 
b/test/elixir/test/bulk_docs_test.exs
index cbbc533..41690fe 100644
--- a/test/elixir/test/bulk_docs_test.exs
+++ b/test/elixir/test/bulk_docs_test.exs
@@ -130,6 +130,17 @@ defmodule BulkDocsTest do
 assert Enum.at(rows, 2)["error"] == "conflict"
   end
 
+  @tag :with_db
+  test "bulk docs raises transaction_too_large error for transaction larger 
than 10MB", ctx do
+docs = [%{_id: "0", a: random_string(16_000_000)}]
+old_size = 
Couch.get("/_node/node1@127.0.0.1/_config/couchdb/max_document_size").body
+set_config_raw("couchdb", "max_document_size", "67108864") # 64M
+resp = Couch.post("/#{ctx[:db_name]}/_bulk_docs", body: %{docs: docs})
+set_config_raw("couchdb", "max_document_size", old_size) # set back
+assert resp.status_code == 413
+assert resp.body["error"] == "transaction_too_large"
+  end
+
   defp bulk_post(docs, db) do
 retry_until(fn ->
   resp = Couch.post("/#{db}/_bulk_docs", body: %{docs: docs})
@@ -152,4 +163,11 @@ defmodule BulkDocsTest do
 assert resp.body["error"] == "bad_request"
 assert resp.body["reason"] == reason
   end
+
+  defp random_string(length) do
+raw = :crypto.strong_rand_bytes(length)
+raw
+|> Base.url_encode64
+|> binary_part(0, length)
+  end
 end



[couchdb] branch transaction_too_large-for-main created (now 1469fb7)

2020-10-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large-for-main
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 1469fb7  convert erlfdb_error 2101 to transaction_too_large

This branch includes the following new commits:

 new 1469fb7  convert erlfdb_error 2101 to transaction_too_large

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: convert erlfdb_error 2101 to transaction_too_large

2020-10-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch transaction_too_large-for-main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 1469fb74754ebbff0632de69378b0e7406f0e0f3
Author: jiangph 
AuthorDate: Tue Oct 13 10:55:21 2020 +0800

convert erlfdb_error 2101 to transaction_too_large
---
 src/chttpd/src/chttpd.erl   |  5 +
 test/elixir/test/bulk_docs_test.exs | 18 ++
 2 files changed, 23 insertions(+)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 3962c86..ebfbd04 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -351,6 +351,8 @@ catch_error(HttpReq, throw, Error) ->
 send_error(HttpReq, Error);
 catch_error(HttpReq, error, database_does_not_exist) ->
 send_error(HttpReq, database_does_not_exist);
+catch_error(HttpReq, error, {erlfdb_error, 2101}) ->
+send_error(HttpReq, transaction_too_large);
 catch_error(HttpReq, Tag, Error) ->
 Stack = erlang:get_stacktrace(),
 % TODO improve logging and metrics collection for client disconnects
@@ -983,6 +985,9 @@ error_info({request_entity_too_large, {attachment, 
AttName}}) ->
 {413, <<"attachment_too_large">>, AttName};
 error_info({request_entity_too_large, DocID}) ->
 {413, <<"document_too_large">>, DocID};
+error_info(transaction_too_large) ->
+{413, <<"transaction_too_large">>,
+<<"The request transaction is larger than 10MB" >>};
 error_info({error, security_migration_updates_disabled}) ->
 {503, <<"security_migration">>, <<"Updates to security docs are disabled 
during "
 "security migration.">>};
diff --git a/test/elixir/test/bulk_docs_test.exs 
b/test/elixir/test/bulk_docs_test.exs
index cbbc533..41690fe 100644
--- a/test/elixir/test/bulk_docs_test.exs
+++ b/test/elixir/test/bulk_docs_test.exs
@@ -130,6 +130,17 @@ defmodule BulkDocsTest do
 assert Enum.at(rows, 2)["error"] == "conflict"
   end
 
+  @tag :with_db
+  test "bulk docs raises transaction_too_large error for transaction larger 
than 10MB", ctx do
+docs = [%{_id: "0", a: random_string(16_000_000)}]
+old_size = 
Couch.get("/_node/node1@127.0.0.1/_config/couchdb/max_document_size").body
+set_config_raw("couchdb", "max_document_size", "67108864") # 64M
+resp = Couch.post("/#{ctx[:db_name]}/_bulk_docs", body: %{docs: docs})
+set_config_raw("couchdb", "max_document_size", old_size) # set back
+assert resp.status_code == 413
+assert resp.body["error"] == "transaction_too_large"
+  end
+
   defp bulk_post(docs, db) do
 retry_until(fn ->
   resp = Couch.post("/#{db}/_bulk_docs", body: %{docs: docs})
@@ -152,4 +163,11 @@ defmodule BulkDocsTest do
 assert resp.body["error"] == "bad_request"
 assert resp.body["reason"] == reason
   end
+
+  defp random_string(length) do
+raw = :crypto.strong_rand_bytes(length)
+raw
+|> Base.url_encode64
+|> binary_part(0, length)
+  end
 end



[couchdb] branch prototype/fdb-layer updated: convert erlfdb_error 2101 to transaction_too_large (#3215)

2020-10-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/prototype/fdb-layer by this 
push:
 new 7bdb432  convert erlfdb_error 2101 to transaction_too_large (#3215)
7bdb432 is described below

commit 7bdb432849f477d0c4451aaf9d41b35ab076e9f3
Author: Peng Hui Jiang 
AuthorDate: Tue Oct 20 20:49:29 2020 +0800

convert erlfdb_error 2101 to transaction_too_large (#3215)
---
 src/chttpd/src/chttpd.erl   |  5 +
 test/elixir/test/bulk_docs_test.exs | 18 ++
 2 files changed, 23 insertions(+)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 1a9b19b..1198dbb 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -362,6 +362,8 @@ catch_error(HttpReq, error, decryption_failed) ->
 send_error(HttpReq, decryption_failed);
 catch_error(HttpReq, error, not_ciphertext) ->
 send_error(HttpReq, not_ciphertext);
+catch_error(HttpReq, error, {erlfdb_error, 2101}) ->
+send_error(HttpReq, transaction_too_large);
 catch_error(HttpReq, Tag, Error) ->
 Stack = erlang:get_stacktrace(),
 % TODO improve logging and metrics collection for client disconnects
@@ -1009,6 +1011,9 @@ error_info({request_entity_too_large, {bulk_get, Max}}) 
when is_integer(Max) ->
 {413, <<"max_bulk_get_count_exceeded">>, integer_to_binary(Max)};
 error_info({request_entity_too_large, DocID}) ->
 {413, <<"document_too_large">>, DocID};
+error_info(transaction_too_large) ->
+{413, <<"transaction_too_large">>,
+<<"The request transaction is larger than 10MB" >>};
 error_info({error, security_migration_updates_disabled}) ->
 {503, <<"security_migration">>, <<"Updates to security docs are disabled 
during "
 "security migration.">>};
diff --git a/test/elixir/test/bulk_docs_test.exs 
b/test/elixir/test/bulk_docs_test.exs
index 1a7c110..d548eef 100644
--- a/test/elixir/test/bulk_docs_test.exs
+++ b/test/elixir/test/bulk_docs_test.exs
@@ -129,6 +129,17 @@ defmodule BulkDocsTest do
 assert Enum.at(rows, 2)["error"] == "conflict"
   end
 
+  @tag :with_db
+  test "bulk docs raises transaction_too_large error for transaction larger 
than 10MB", ctx do
+docs = [%{_id: "0", a: random_string(16_000_000)}]
+old_size = 
Couch.get("/_node/node1@127.0.0.1/_config/couchdb/max_document_size").body
+set_config_raw("couchdb", "max_document_size", "67108864") # 64M
+resp = Couch.post("/#{ctx[:db_name]}/_bulk_docs", body: %{docs: docs})
+set_config_raw("couchdb", "max_document_size", old_size) # set back
+assert resp.status_code == 413
+assert resp.body["error"] == "transaction_too_large"
+  end
+
   defp bulk_post(docs, db) do
 retry_until(fn ->
   resp = Couch.post("/#{db}/_bulk_docs", body: %{docs: docs})
@@ -151,4 +162,11 @@ defmodule BulkDocsTest do
 assert resp.body["error"] == "bad_request"
 assert resp.body["reason"] == reason
   end
+
+  defp random_string(length) do
+raw = :crypto.strong_rand_bytes(length)
+raw
+|> Base.url_encode64
+|> binary_part(0, length)
+  end
 end



[couchdb] branch transaction_too_large updated (e275669 -> 640c173)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard e275669  convert erlfdb_error 2101 to transaction_too_large
 add 640c173  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (e275669)
\
 N -- N -- N   refs/heads/transaction_too_large (640c173)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (9f3fb54 -> e275669)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 9f3fb54  convert erlfdb_error 2101 to transaction_too_large
 add e275669  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (9f3fb54)
\
 N -- N -- N   refs/heads/transaction_too_large (e275669)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (92b624f -> 9f3fb54)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 92b624f  convert erlfdb_error 2101 to transaction_too_large
 add 9f3fb54  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (92b624f)
\
 N -- N -- N   refs/heads/transaction_too_large (9f3fb54)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (0ee33a1 -> 92b624f)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 0ee33a1  convert erlfdb_error 2101 to transaction_too_large
 add 92b624f  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (0ee33a1)
\
 N -- N -- N   refs/heads/transaction_too_large (92b624f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (6bf5516 -> 0ee33a1)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 6bf5516  convert erlfdb_error 2101 to transaction_too_large
 add 0ee33a1  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6bf5516)
\
 N -- N -- N   refs/heads/transaction_too_large (0ee33a1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (1f93a70 -> 6bf5516)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 1f93a70  convert erlfdb_error 2101 to transaction_too_large
 add 6bf5516  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1f93a70)
\
 N -- N -- N   refs/heads/transaction_too_large (6bf5516)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (c6148fe -> 1f93a70)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard c6148fe  convert erlfdb_error 2101 to transaction_too_large
 add 1f93a70  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (c6148fe)
\
 N -- N -- N   refs/heads/transaction_too_large (1f93a70)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (7e97a04 -> c6148fe)

2020-10-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 7e97a04  check transaction_too_large error message for large document 
size
 discard 4f7caf7  address Nick and Donat's comments
 discard ad48e5a  convert erlfdb_error 2101 to transaction_too_large
 add c6148fe  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7e97a04)
\
 N -- N -- N   refs/heads/transaction_too_large (c6148fe)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 test/elixir/test/bulk_docs_test.exs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



[couchdb] branch transaction_too_large updated (a0ba69a -> 7e97a04)

2020-10-18 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard a0ba69a  check transaction_too_large error message for large document 
size
 add 7e97a04  check transaction_too_large error message for large document 
size

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (a0ba69a)
\
 N -- N -- N   refs/heads/transaction_too_large (7e97a04)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch transaction_too_large updated (e01a226 -> a0ba69a)

2020-10-18 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard e01a226  check transaction_too_large error message for large document 
size
 add a0ba69a  check transaction_too_large error message for large document 
size

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (e01a226)
\
 N -- N -- N   refs/heads/transaction_too_large (a0ba69a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 test/elixir/test/bulk_docs_test.exs | 1 +
 1 file changed, 1 insertion(+)



[couchdb] branch transaction_too_large updated (4f7caf7 -> e01a226)

2020-10-18 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 4f7caf7  address Nick and Donat's comments
 add e01a226  check transaction_too_large error message for large document 
size

No new revisions were added by this update.

Summary of changes:
 test/elixir/test/bulk_docs_test.exs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)



[couchdb] branch transaction_too_large updated (d4557f2 -> 4f7caf7)

2020-10-16 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard d4557f2  address Nick and Donat's comments
 add 4f7caf7  address Nick and Donat's comments

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d4557f2)
\
 N -- N -- N   refs/heads/transaction_too_large (4f7caf7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/chttpd/src/chttpd.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[couchdb] branch transaction_too_large updated (cccdcdf -> d4557f2)

2020-10-16 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard cccdcdf  address Nick and Donat's comments
 add d4557f2  address Nick and Donat's comments

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (cccdcdf)
\
 N -- N -- N   refs/heads/transaction_too_large (d4557f2)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 test/elixir/test/bulk_docs_test.exs | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)



[couchdb] branch transaction_too_large updated (f33459d -> cccdcdf)

2020-10-15 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard f33459d  address Nick and Donat's comments
 add cccdcdf  address Nick and Donat's comments

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (f33459d)
\
 N -- N -- N   refs/heads/transaction_too_large (cccdcdf)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/chttpd/src/chttpd.erl   | 2 +-
 test/elixir/test/bulk_docs_test.exs | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)



[couchdb] branch transaction_too_large updated (ad48e5a -> f33459d)

2020-10-15 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from ad48e5a  convert erlfdb_error 2101 to transaction_too_large
 add f33459d  address Nick and Donat's comments

No new revisions were added by this update.

Summary of changes:
 src/chttpd/src/chttpd.erl   |  9 -
 test/elixir/test/bulk_docs_test.exs | 10 ++
 2 files changed, 14 insertions(+), 5 deletions(-)



[couchdb] branch transaction_too_large updated (d0404f0 -> ad48e5a)

2020-10-12 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard d0404f0  convert erlfdb_error 2101 to transaction_too_large
 add ad48e5a  convert erlfdb_error 2101 to transaction_too_large

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (d0404f0)
\
 N -- N -- N   refs/heads/transaction_too_large (ad48e5a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] 01/01: convert erlfdb_error 2101 to transaction_too_large

2020-10-12 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d0404f05b05ca26ca1c59f8413ed64f3f7ca2fa2
Author: jiangph 
AuthorDate: Tue Oct 13 10:55:21 2020 +0800

convert erlfdb_error 2101 to transaction_too_large
---
 src/chttpd/src/chttpd.erl | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 1a9b19b..04f65c9 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -362,6 +362,8 @@ catch_error(HttpReq, error, decryption_failed) ->
 send_error(HttpReq, decryption_failed);
 catch_error(HttpReq, error, not_ciphertext) ->
 send_error(HttpReq, not_ciphertext);
+catch_error(HttpReq, error, {erlfdb_error,2101}) ->
+send_error(HttpReq, {request_transcation_too_large, 2101});
 catch_error(HttpReq, Tag, Error) ->
 Stack = erlang:get_stacktrace(),
 % TODO improve logging and metrics collection for client disconnects
@@ -1009,6 +1011,10 @@ error_info({request_entity_too_large, {bulk_get, Max}}) 
when is_integer(Max) ->
 {413, <<"max_bulk_get_count_exceeded">>, integer_to_binary(Max)};
 error_info({request_entity_too_large, DocID}) ->
 {413, <<"document_too_large">>, DocID};
+error_info({request_transcation_too_large, Code}) ->
+CodeBin = integer_to_binary(Code),
+{413, <<"request_transcation_too_large">>,
+<<"The request transcation is too large. (", CodeBin/binary, ")" >>};
 error_info({error, security_migration_updates_disabled}) ->
 {503, <<"security_migration">>, <<"Updates to security docs are disabled 
during "
 "security migration.">>};



[couchdb] branch transaction_too_large created (now d0404f0)

2020-10-12 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch transaction_too_large
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at d0404f0  convert erlfdb_error 2101 to transaction_too_large

This branch includes the following new commits:

 new d0404f0  convert erlfdb_error 2101 to transaction_too_large

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] branch master updated: Add module tag to elixir test cases (#3178)

2020-09-30 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
 new 1719500  Add module tag to elixir test cases (#3178)
1719500 is described below

commit 1719500d648cfeb396b9c503bbd86fb3dcdca35f
Author: Peng Hui Jiang 
AuthorDate: Wed Sep 30 23:04:45 2020 +0800

Add module tag to elixir test cases (#3178)

Some elixir test cases don't have actual module tag. Add tags to
help include or exclude them in CI test.
---
 test/elixir/test/reshard_all_docs_test.exs| 1 +
 test/elixir/test/reshard_basic_test.exs   | 1 +
 test/elixir/test/reshard_changes_feed.exs | 1 +
 test/elixir/test/update_documents_test.exs| 1 +
 test/elixir/test/view_collation_raw_test.exs  | 1 +
 test/elixir/test/view_collation_test.exs  | 1 +
 test/elixir/test/view_compaction_test.exs | 1 +
 test/elixir/test/view_conflicts_test.exs  | 1 +
 test/elixir/test/view_errors_test.exs | 1 +
 test/elixir/test/view_include_docs_test.exs   | 1 +
 test/elixir/test/view_multi_key_all_docs_test.exs | 1 +
 test/elixir/test/view_multi_key_design_test.exs   | 1 +
 test/elixir/test/view_sandboxing_test.exs | 1 +
 13 files changed, 13 insertions(+)

diff --git a/test/elixir/test/reshard_all_docs_test.exs 
b/test/elixir/test/reshard_all_docs_test.exs
index 042437e..bd3893d 100644
--- a/test/elixir/test/reshard_all_docs_test.exs
+++ b/test/elixir/test/reshard_all_docs_test.exs
@@ -6,6 +6,7 @@ defmodule ReshardAllDocsTest do
   Test _all_docs interaction with resharding
   """
 
+  @moduletag :reshard_all_docs
   @moduletag kind: :cluster
 
   setup do
diff --git a/test/elixir/test/reshard_basic_test.exs 
b/test/elixir/test/reshard_basic_test.exs
index 92f8145..6d91818 100644
--- a/test/elixir/test/reshard_basic_test.exs
+++ b/test/elixir/test/reshard_basic_test.exs
@@ -6,6 +6,7 @@ defmodule ReshardBasicTest do
   Test resharding basic functionality
   """
   
+  @moduletag :reshard_basic
   @moduletag kind: :cluster
 
   setup_all do
diff --git a/test/elixir/test/reshard_changes_feed.exs 
b/test/elixir/test/reshard_changes_feed.exs
index ad55e57..3086275 100644
--- a/test/elixir/test/reshard_changes_feed.exs
+++ b/test/elixir/test/reshard_changes_feed.exs
@@ -6,6 +6,7 @@ defmodule ReshardChangesFeedTest do
   Test _changes interaction with resharding
   """
 
+  @moduletag :reshard_changes_feed
   @moduletag kind: :cluster
 
   setup do
diff --git a/test/elixir/test/update_documents_test.exs 
b/test/elixir/test/update_documents_test.exs
index fcbdbea..bd5e0f1 100644
--- a/test/elixir/test/update_documents_test.exs
+++ b/test/elixir/test/update_documents_test.exs
@@ -1,6 +1,7 @@
 defmodule UpdateDocumentsTest do
   use CouchTestCase
 
+  @moduletag :docs
   @moduletag kind: :single_node
 
   @ddoc %{
diff --git a/test/elixir/test/view_collation_raw_test.exs 
b/test/elixir/test/view_collation_raw_test.exs
index 1bcd397..b9c40f6 100644
--- a/test/elixir/test/view_collation_raw_test.exs
+++ b/test/elixir/test/view_collation_raw_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCollationRawTest do
   This is a port of the view_collation_raw.js suite
   """
 
+  @moduletag :view_collation_raw
   @moduletag kind: :single_node
 
   @values [
diff --git a/test/elixir/test/view_collation_test.exs 
b/test/elixir/test/view_collation_test.exs
index 1e3fec0..984d412 100644
--- a/test/elixir/test/view_collation_test.exs
+++ b/test/elixir/test/view_collation_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCollationTest do
   This is a port of the view_collation.js suite
   """
 
+  @moduletag :view_collation
   @moduletag kind: :single_node
 
   @values [
diff --git a/test/elixir/test/view_compaction_test.exs 
b/test/elixir/test/view_compaction_test.exs
index 5bdd2ea..ed7461a 100644
--- a/test/elixir/test/view_compaction_test.exs
+++ b/test/elixir/test/view_compaction_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCompactionTest do
   This is a port of the view_compaction.js suite
   """
   
+  @moduletag :view_compaction
   @moduletag kind: :single_node
   
   @num_docs 1000
diff --git a/test/elixir/test/view_conflicts_test.exs 
b/test/elixir/test/view_conflicts_test.exs
index 9261b1e..89d9cb4 100644
--- a/test/elixir/test/view_conflicts_test.exs
+++ b/test/elixir/test/view_conflicts_test.exs
@@ -1,6 +1,7 @@
 defmodule ViewConflictsTest do
   use CouchTestCase
 
+  @moduletag :view_conflicts
   @moduletag kind: :single_node
 
   setup_all do
diff --git a/test/elixir/test/view_errors_test.exs 
b/test/elixir/test/view_errors_test.exs
index 80067ec..1e8f880 100644
--- a/test/elixir/test/view_errors_test.exs
+++ b/test/elixir/test/view_errors_test.exs
@@ -1,6 +1,7 @@
 defmodule ViewErrorsTest do
   use CouchTestCase
 
+  @moduletag :vi

[couchdb] branch add-tag-to-elixir updated (49260e5 -> 1e4eccc)

2020-09-29 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch add-tag-to-elixir
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 49260e5  Add module tag to elixir test cases
 add 796d714  port rewrite and rewrite_js tests into elixir
 add 1e4eccc  Add module tag to elixir test cases

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (49260e5)
\
 N -- N -- N   refs/heads/add-tag-to-elixir (1e4eccc)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 test/elixir/README.md   |   2 +-
 test/elixir/lib/couch_raw.ex| 105 
 test/elixir/test/changes_async_test.exs | 103 
 test/elixir/test/rewrite_js_test.exs| 411 
 test/elixir/test/rewrite_test.exs   | 181 +-
 test/javascript/tests/rewrite.js|   2 +-
 test/javascript/tests/rewrite_js.js |   3 +-
 7 files changed, 691 insertions(+), 116 deletions(-)
 create mode 100644 test/elixir/lib/couch_raw.ex
 create mode 100644 test/elixir/test/rewrite_js_test.exs



[couchdb] branch add-tag-to-elixir updated (5c8bd3b -> 49260e5)

2020-09-28 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch add-tag-to-elixir
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 5c8bd3b  Add module tag to elixir test cases
 add 49260e5  Add module tag to elixir test cases

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5c8bd3b)
\
 N -- N -- N   refs/heads/add-tag-to-elixir (49260e5)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 test/elixir/test/view_compaction_test.exs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[couchdb] branch add-tag-to-elixir updated (70d665e -> 5c8bd3b)

2020-09-28 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch add-tag-to-elixir
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 70d665e  Add module tag to elixir test cases
 new 5c8bd3b  Add module tag to elixir test cases

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (70d665e)
\
 N -- N -- N   refs/heads/add-tag-to-elixir (5c8bd3b)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 test/elixir/test/view_compaction_test.exs   | 4 ++--
 test/elixir/test/view_multi_key_design_test.exs | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)



[couchdb] 01/01: Add module tag to elixir test cases

2020-09-28 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch add-tag-to-elixir
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 5c8bd3b71e4bfda541c7861e95c5cf0881bc94dd
Author: jiangph 
AuthorDate: Tue Sep 29 11:17:56 2020 +0800

Add module tag to elixir test cases

Some elixir test cases don't have actual module tag. Add tags to
help include or exclude them in CI test.
---
 test/elixir/test/reshard_all_docs_test.exs| 1 +
 test/elixir/test/reshard_basic_test.exs   | 1 +
 test/elixir/test/reshard_changes_feed.exs | 1 +
 test/elixir/test/update_documents_test.exs| 1 +
 test/elixir/test/view_collation_raw_test.exs  | 1 +
 test/elixir/test/view_collation_test.exs  | 1 +
 test/elixir/test/view_compaction_test.exs | 3 ++-
 test/elixir/test/view_conflicts_test.exs  | 1 +
 test/elixir/test/view_errors_test.exs | 1 +
 test/elixir/test/view_include_docs_test.exs   | 1 +
 test/elixir/test/view_multi_key_all_docs_test.exs | 1 +
 test/elixir/test/view_multi_key_design_test.exs   | 1 +
 test/elixir/test/view_sandboxing_test.exs | 1 +
 13 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/test/elixir/test/reshard_all_docs_test.exs 
b/test/elixir/test/reshard_all_docs_test.exs
index 042437e..bd3893d 100644
--- a/test/elixir/test/reshard_all_docs_test.exs
+++ b/test/elixir/test/reshard_all_docs_test.exs
@@ -6,6 +6,7 @@ defmodule ReshardAllDocsTest do
   Test _all_docs interaction with resharding
   """
 
+  @moduletag :reshard_all_docs
   @moduletag kind: :cluster
 
   setup do
diff --git a/test/elixir/test/reshard_basic_test.exs 
b/test/elixir/test/reshard_basic_test.exs
index 92f8145..6d91818 100644
--- a/test/elixir/test/reshard_basic_test.exs
+++ b/test/elixir/test/reshard_basic_test.exs
@@ -6,6 +6,7 @@ defmodule ReshardBasicTest do
   Test resharding basic functionality
   """
   
+  @moduletag :reshard_basic
   @moduletag kind: :cluster
 
   setup_all do
diff --git a/test/elixir/test/reshard_changes_feed.exs 
b/test/elixir/test/reshard_changes_feed.exs
index ad55e57..3086275 100644
--- a/test/elixir/test/reshard_changes_feed.exs
+++ b/test/elixir/test/reshard_changes_feed.exs
@@ -6,6 +6,7 @@ defmodule ReshardChangesFeedTest do
   Test _changes interaction with resharding
   """
 
+  @moduletag :reshard_changes_feed
   @moduletag kind: :cluster
 
   setup do
diff --git a/test/elixir/test/update_documents_test.exs 
b/test/elixir/test/update_documents_test.exs
index fcbdbea..bd5e0f1 100644
--- a/test/elixir/test/update_documents_test.exs
+++ b/test/elixir/test/update_documents_test.exs
@@ -1,6 +1,7 @@
 defmodule UpdateDocumentsTest do
   use CouchTestCase
 
+  @moduletag :docs
   @moduletag kind: :single_node
 
   @ddoc %{
diff --git a/test/elixir/test/view_collation_raw_test.exs 
b/test/elixir/test/view_collation_raw_test.exs
index 1bcd397..b9c40f6 100644
--- a/test/elixir/test/view_collation_raw_test.exs
+++ b/test/elixir/test/view_collation_raw_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCollationRawTest do
   This is a port of the view_collation_raw.js suite
   """
 
+  @moduletag :view_collation_raw
   @moduletag kind: :single_node
 
   @values [
diff --git a/test/elixir/test/view_collation_test.exs 
b/test/elixir/test/view_collation_test.exs
index 1e3fec0..984d412 100644
--- a/test/elixir/test/view_collation_test.exs
+++ b/test/elixir/test/view_collation_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCollationTest do
   This is a port of the view_collation.js suite
   """
 
+  @moduletag :view_collation
   @moduletag kind: :single_node
 
   @values [
diff --git a/test/elixir/test/view_compaction_test.exs 
b/test/elixir/test/view_compaction_test.exs
index 5bdd2ea..f827e82 100644
--- a/test/elixir/test/view_compaction_test.exs
+++ b/test/elixir/test/view_compaction_test.exs
@@ -6,8 +6,9 @@ defmodule ViewCompactionTest do
   This is a port of the view_compaction.js suite
   """
   
+  @moduletag :view_compaction
   @moduletag kind: :single_node
-  
+
   @num_docs 1000
 
   @ddoc %{
diff --git a/test/elixir/test/view_conflicts_test.exs 
b/test/elixir/test/view_conflicts_test.exs
index 9261b1e..89d9cb4 100644
--- a/test/elixir/test/view_conflicts_test.exs
+++ b/test/elixir/test/view_conflicts_test.exs
@@ -1,6 +1,7 @@
 defmodule ViewConflictsTest do
   use CouchTestCase
 
+  @moduletag :view_conflicts
   @moduletag kind: :single_node
 
   setup_all do
diff --git a/test/elixir/test/view_errors_test.exs 
b/test/elixir/test/view_errors_test.exs
index 80067ec..1e8f880 100644
--- a/test/elixir/test/view_errors_test.exs
+++ b/test/elixir/test/view_errors_test.exs
@@ -1,6 +1,7 @@
 defmodule ViewErrorsTest do
   use CouchTestCase
 
+  @moduletag :view_errors
   @moduletag kind: :single_node
 
   @document %{integer: 1, string: "1", array: [1, 2, 3]}
diff --git a/test

[couchdb] 01/01: Add module tag to elixir test cases

2020-09-28 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch add-tag-to-elixir
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 70d665e1ef83c79c3fcfd4561f3dd21e85dbc81e
Author: jiangph 
AuthorDate: Tue Sep 29 11:03:45 2020 +0800

Add module tag to elixir test cases

Some elixir test cases don't have actual module tag. Add tags to
help include or exclude them in CI test.
---
 test/elixir/test/reshard_all_docs_test.exs| 1 +
 test/elixir/test/reshard_basic_test.exs   | 1 +
 test/elixir/test/reshard_changes_feed.exs | 1 +
 test/elixir/test/update_documents_test.exs| 1 +
 test/elixir/test/view_collation_raw_test.exs  | 1 +
 test/elixir/test/view_collation_test.exs  | 1 +
 test/elixir/test/view_compaction_test.exs | 3 ++-
 test/elixir/test/view_conflicts_test.exs  | 1 +
 test/elixir/test/view_errors_test.exs | 1 +
 test/elixir/test/view_include_docs_test.exs   | 1 +
 test/elixir/test/view_multi_key_all_docs_test.exs | 1 +
 test/elixir/test/view_multi_key_design_test.exs   | 3 ++-
 test/elixir/test/view_sandboxing_test.exs | 1 +
 13 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/test/elixir/test/reshard_all_docs_test.exs 
b/test/elixir/test/reshard_all_docs_test.exs
index 042437e..bd3893d 100644
--- a/test/elixir/test/reshard_all_docs_test.exs
+++ b/test/elixir/test/reshard_all_docs_test.exs
@@ -6,6 +6,7 @@ defmodule ReshardAllDocsTest do
   Test _all_docs interaction with resharding
   """
 
+  @moduletag :reshard_all_docs
   @moduletag kind: :cluster
 
   setup do
diff --git a/test/elixir/test/reshard_basic_test.exs 
b/test/elixir/test/reshard_basic_test.exs
index 92f8145..6d91818 100644
--- a/test/elixir/test/reshard_basic_test.exs
+++ b/test/elixir/test/reshard_basic_test.exs
@@ -6,6 +6,7 @@ defmodule ReshardBasicTest do
   Test resharding basic functionality
   """
   
+  @moduletag :reshard_basic
   @moduletag kind: :cluster
 
   setup_all do
diff --git a/test/elixir/test/reshard_changes_feed.exs 
b/test/elixir/test/reshard_changes_feed.exs
index ad55e57..3086275 100644
--- a/test/elixir/test/reshard_changes_feed.exs
+++ b/test/elixir/test/reshard_changes_feed.exs
@@ -6,6 +6,7 @@ defmodule ReshardChangesFeedTest do
   Test _changes interaction with resharding
   """
 
+  @moduletag :reshard_changes_feed
   @moduletag kind: :cluster
 
   setup do
diff --git a/test/elixir/test/update_documents_test.exs 
b/test/elixir/test/update_documents_test.exs
index fcbdbea..bd5e0f1 100644
--- a/test/elixir/test/update_documents_test.exs
+++ b/test/elixir/test/update_documents_test.exs
@@ -1,6 +1,7 @@
 defmodule UpdateDocumentsTest do
   use CouchTestCase
 
+  @moduletag :docs
   @moduletag kind: :single_node
 
   @ddoc %{
diff --git a/test/elixir/test/view_collation_raw_test.exs 
b/test/elixir/test/view_collation_raw_test.exs
index 1bcd397..b9c40f6 100644
--- a/test/elixir/test/view_collation_raw_test.exs
+++ b/test/elixir/test/view_collation_raw_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCollationRawTest do
   This is a port of the view_collation_raw.js suite
   """
 
+  @moduletag :view_collation_raw
   @moduletag kind: :single_node
 
   @values [
diff --git a/test/elixir/test/view_collation_test.exs 
b/test/elixir/test/view_collation_test.exs
index 1e3fec0..984d412 100644
--- a/test/elixir/test/view_collation_test.exs
+++ b/test/elixir/test/view_collation_test.exs
@@ -6,6 +6,7 @@ defmodule ViewCollationTest do
   This is a port of the view_collation.js suite
   """
 
+  @moduletag :view_collation
   @moduletag kind: :single_node
 
   @values [
diff --git a/test/elixir/test/view_compaction_test.exs 
b/test/elixir/test/view_compaction_test.exs
index 5bdd2ea..e27da52 100644
--- a/test/elixir/test/view_compaction_test.exs
+++ b/test/elixir/test/view_compaction_test.exs
@@ -5,7 +5,8 @@ defmodule ViewCompactionTest do
   Test CouchDB View Compaction Behavior
   This is a port of the view_compaction.js suite
   """
-  
+
+  @moduletag :view_compaction
   @moduletag kind: :single_node
   
   @num_docs 1000
diff --git a/test/elixir/test/view_conflicts_test.exs 
b/test/elixir/test/view_conflicts_test.exs
index 9261b1e..89d9cb4 100644
--- a/test/elixir/test/view_conflicts_test.exs
+++ b/test/elixir/test/view_conflicts_test.exs
@@ -1,6 +1,7 @@
 defmodule ViewConflictsTest do
   use CouchTestCase
 
+  @moduletag :view_conflicts
   @moduletag kind: :single_node
 
   setup_all do
diff --git a/test/elixir/test/view_errors_test.exs 
b/test/elixir/test/view_errors_test.exs
index 80067ec..1e8f880 100644
--- a/test/elixir/test/view_errors_test.exs
+++ b/test/elixir/test/view_errors_test.exs
@@ -1,6 +1,7 @@
 defmodule ViewErrorsTest do
   use CouchTestCase
 
+  @moduletag :view_errors
   @moduletag kind: :single_node
 
   @document %{integer: 1, string: "1&q

[couchdb] branch add-tag-to-elixir created (now 70d665e)

2020-09-28 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch add-tag-to-elixir
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 70d665e  Add module tag to elixir test cases

This branch includes the following new commits:

 new 70d665e  Add module tag to elixir test cases

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] branch print-stack-sm60 created (now 9de8e62)

2020-09-18 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch print-stack-sm60
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 9de8e62  Print stack if name and stack of exception are present

This branch includes the following new commits:

 new 9de8e62  Print stack if name and stack of exception are present

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: Print stack if name and stack of exception are present

2020-09-18 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch print-stack-sm60
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9de8e6212eb65f60f382dd5a5ab408787047aa34
Author: jiangph 
AuthorDate: Fri Sep 18 18:27:44 2020 +0800

Print stack if name and stack of exception are present
---
 share/server/loop.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/share/server/loop.js b/share/server/loop.js
index 5d77389..f3d9aa5 100644
--- a/share/server/loop.js
+++ b/share/server/loop.js
@@ -130,6 +130,8 @@ var Loop = function() {
 } else if (e.error && e.reason) {
   // compatibility with old error format
   respond(["error", e.error, e.reason]);
+   }  else if (e.name && e.stack) {
+  respond(["error", e.name, e.stack]);
 } else if (e.name) {
   respond(["error", e.name, e]);
 } else {



[couchdb] 01/01: Merge pull request #3119 from apache/backport-dreyfus-cleanup-with-invalid-ddoc

2020-09-01 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 8ef3c0d5510312e6f73d5aac772bf4e113001f5d
Merge: bb869c1 b69a11a
Author: Peng Hui Jiang 
AuthorDate: Tue Sep 1 17:05:19 2020 +0800

Merge pull request #3119 from 
apache/backport-dreyfus-cleanup-with-invalid-ddoc

3.x backport: Allow to continue to cleanup search index even if there is 
invalid ddoc

 src/dreyfus/src/dreyfus_fabric_cleanup.erl   | 16 ++--
 src/dreyfus/test/elixir/test/search_test.exs | 25 +
 2 files changed, 35 insertions(+), 6 deletions(-)



[couchdb] branch 3.x updated (bb869c1 -> 8ef3c0d)

2020-09-01 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch 3.x
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from bb869c1  bypass partition query limit for mango (#3114)
 add b69a11a  Allow to continue to cleanup search index even if there is 
invalid ddoc
 new 8ef3c0d  Merge pull request #3119 from 
apache/backport-dreyfus-cleanup-with-invalid-ddoc

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/dreyfus/src/dreyfus_fabric_cleanup.erl   | 16 ++--
 src/dreyfus/test/elixir/test/search_test.exs | 25 +
 2 files changed, 35 insertions(+), 6 deletions(-)



[couchdb] 01/01: Allow to continue to cleanup search index even if there is invalid ddoc

2020-09-01 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch backport-dreyfus-cleanup-with-invalid-ddoc
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit b69a11a14acae8ece68244b079d3329e60be4e70
Author: jiangph 
AuthorDate: Tue Sep 1 16:26:20 2020 +0800

Allow to continue to cleanup search index even if there is invalid ddoc

In some situation where design document for search index created by
customer is not valid, the _search_cleanup endpoint will stop to clean
up. This will leave some search index orphan. The change is to allow
to continue to clean up search index even if there is invalid design
document for search.
---
 src/dreyfus/src/dreyfus_fabric_cleanup.erl   | 16 ++--
 src/dreyfus/test/elixir/test/search_test.exs | 25 +
 2 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/src/dreyfus/src/dreyfus_fabric_cleanup.erl 
b/src/dreyfus/src/dreyfus_fabric_cleanup.erl
index 2840a2f..6817127 100644
--- a/src/dreyfus/src/dreyfus_fabric_cleanup.erl
+++ b/src/dreyfus/src/dreyfus_fabric_cleanup.erl
@@ -30,12 +30,16 @@ go(DbName) ->
 ok.
 
 active_sigs(#doc{body={Fields}}=Doc) ->
-{RawIndexes} = couch_util:get_value(<<"indexes">>, Fields, {[]}),
-{IndexNames, _} = lists:unzip(RawIndexes),
-[begin
- {ok, Index} = dreyfus_index:design_doc_to_index(Doc, IndexName),
- Index#index.sig
- end || IndexName <- IndexNames].
+try
+{RawIndexes} = couch_util:get_value(<<"indexes">>, Fields, {[]}),
+{IndexNames, _} = lists:unzip(RawIndexes),
+[begin
+ {ok, Index} = dreyfus_index:design_doc_to_index(Doc, IndexName),
+ Index#index.sig
+ end || IndexName <- IndexNames]
+catch error:{badmatch, _Error} ->
+[]
+end.
 
 cleanup_local_purge_doc(DbName, ActiveSigs) ->
 {ok, BaseDir} = clouseau_rpc:get_root_dir(),
diff --git a/src/dreyfus/test/elixir/test/search_test.exs 
b/src/dreyfus/test/elixir/test/search_test.exs
index e524a5c..829b339 100644
--- a/src/dreyfus/test/elixir/test/search_test.exs
+++ b/src/dreyfus/test/elixir/test/search_test.exs
@@ -37,6 +37,20 @@ defmodule SearchTest do
 assert Map.has_key?(resp.body, "ok") == true
   end
 
+  def create_invalid_ddoc(db_name, opts \\ %{}) do
+invalid_ddoc = %{
+  :indexes => [
+%{"name" => "foo",  "ddoc" => "bar", "type" => "text"},
+  ]
+}
+
+ddoc = Enum.into(opts, invalid_ddoc)
+
+resp = Couch.put("/#{db_name}/_design/search", body: ddoc)
+assert resp.status_code in [201, 202]
+assert Map.has_key?(resp.body, "ok") == true
+  end
+
   def get_items (resp) do
 %{:body => %{"rows" => rows}} = resp
 Enum.map(rows, fn row -> row["doc"]["item"] end)
@@ -198,4 +212,15 @@ defmodule SearchTest do
 ids = get_items(resp)
 assert Enum.sort(ids) == ["apple"]
   end
+
+  @tag :with_db
+  test "clean up search index with invalid design document", context do
+db_name = context[:db_name]
+create_search_docs(db_name)
+create_ddoc(db_name)
+create_invalid_ddoc(db_name)
+
+resp = Couch.post("/#{db_name}/_search_cleanup")
+assert resp.status_code in [201, 202]
+  end
 end



[couchdb] branch backport-dreyfus-cleanup-with-invalid-ddoc created (now b69a11a)

2020-09-01 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch backport-dreyfus-cleanup-with-invalid-ddoc
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at b69a11a  Allow to continue to cleanup search index even if there is 
invalid ddoc

This branch includes the following new commits:

 new b69a11a  Allow to continue to cleanup search index even if there is 
invalid ddoc

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: Merge pull request #3118 from apache/dreyfus-cleanup-with-invalid-ddoc

2020-09-01 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 27eefab014b2c8d65a167f715721090019add33a
Merge: 0c3c4b6 253d64a
Author: Peng Hui Jiang 
AuthorDate: Tue Sep 1 16:03:10 2020 +0800

Merge pull request #3118 from apache/dreyfus-cleanup-with-invalid-ddoc

Allow to continue to cleanup search index even if there is invalid design 
document

 src/dreyfus/src/dreyfus_fabric_cleanup.erl   | 16 ++--
 src/dreyfus/test/elixir/test/search_test.exs | 25 +
 2 files changed, 35 insertions(+), 6 deletions(-)



[couchdb] branch master updated (0c3c4b6 -> 27eefab)

2020-09-01 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 0c3c4b6  Merge pull request #3116 from apache/fix-explain-text-indexes
 add 253d64a  Allow to continue to cleanup search index even if there is 
invalid ddoc
 new 27eefab  Merge pull request #3118 from 
apache/dreyfus-cleanup-with-invalid-ddoc

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/dreyfus/src/dreyfus_fabric_cleanup.erl   | 16 ++--
 src/dreyfus/test/elixir/test/search_test.exs | 25 +
 2 files changed, 35 insertions(+), 6 deletions(-)



[couchdb] branch dreyfus-cleanup-with-invalid-ddoc created (now 253d64a)

2020-08-31 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch dreyfus-cleanup-with-invalid-ddoc
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 253d64a  Allow to continue to cleanup search index even if there is 
invalid ddoc

No new revisions were added by this update.



[couchdb] branch dreyfus-cleanup-with-invalid-ddoc created (now 253d64a)

2020-08-31 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch dreyfus-cleanup-with-invalid-ddoc
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 253d64a  Allow to continue to cleanup search index even if there is 
invalid ddoc

No new revisions were added by this update.



[couchdb] branch master updated (7d9f115 -> 3091c93)

2020-08-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 7d9f115  Merge pull request #3075 from apache/couch_index_server_crash2
 add 11e8d0d  fixup: Build couch_js for redhat linux
 new 3091c93  Merge pull request #3056 from 
apache/build-couchjs-for-redhat-linux

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/rebar.config.script | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[couchdb] 01/01: Merge pull request #3056 from apache/build-couchjs-for-redhat-linux

2020-08-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3091c93cd49e8bafeb91b5e5074b310102804bb9
Merge: 7d9f115 11e8d0d
Author: Peng Hui Jiang 
AuthorDate: Thu Aug 20 14:11:26 2020 +0800

Merge pull request #3056 from apache/build-couchjs-for-redhat-linux

fixup: Build couch_js for redhat linux

 src/couch/rebar.config.script | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[couchdb] branch build-couchjs-for-redhat-linux updated (fc9037c -> 11e8d0d)

2020-08-19 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch build-couchjs-for-redhat-linux
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard fc9037c  fixup: Build couch_js for redhat linux
 add e0cbe1c  Remove wrongly commited file from #2955 (#3070)
 add 57e3501  Unlink index pid and swallow EXIT message if present
 add c66694f  Merge pull request #3068 from apache/couch_index_server_crash
 add 7c9094c  Validate shard specific query params on db create request
 add 5004f99  Don't crash couch_index_server if the db isn't known yet
 add 7d9f115  Merge pull request #3075 from apache/couch_index_server_crash2
 add 11e8d0d  fixup: Build couch_js for redhat linux

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (fc9037c)
\
 N -- N -- N   refs/heads/build-couchjs-for-redhat-linux (11e8d0d)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/chttpd/src/chttpd_auth.erl.orig|  89 
 src/chttpd/src/chttpd_db.erl   | 162 +++--
 src/couch/src/couch_util.erl   |  12 +++
 src/couch_index/src/couch_index_server.erl |  16 ++-
 4 files changed, 178 insertions(+), 101 deletions(-)
 delete mode 100644 src/chttpd/src/chttpd_auth.erl.orig



[couchdb] 01/01: Merge pull request #3057 from apache/build-fdb-couchjs-for-redhat-linux

2020-08-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit dff8bc9c254b1657279f55f21485b29f1b08cad6
Merge: bf4265e 042347e
Author: Peng Hui Jiang 
AuthorDate: Thu Aug 6 16:17:04 2020 +0800

Merge pull request #3057 from apache/build-fdb-couchjs-for-redhat-linux

fixup: Build couch_js for redhat linux

 src/couch/rebar.config.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[couchdb] branch prototype/fdb-layer updated (bf4265e -> dff8bc9)

2020-08-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from bf4265e  Merge pull request #3060 from 
apache/prototype/fdb-layer-ebtree-speedy-tests
 add 042347e  fixup: Build couch_js for redhat linux
 new dff8bc9  Merge pull request #3057 from 
apache/build-fdb-couchjs-for-redhat-linux

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/rebar.config.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[couchdb] branch build-couchjs-for-redhat-linux updated (2e557a2 -> fc9037c)

2020-08-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch build-couchjs-for-redhat-linux
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 2e557a2  fixup: Build couch_js for redhat linux
 add fc9037c  fixup: Build couch_js for redhat linux

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2e557a2)
\
 N -- N -- N   refs/heads/build-couchjs-for-redhat-linux (fc9037c)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/couch/rebar.config.script | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)



[couchdb] branch build-fdb-couchjs-for-redhat-linux updated (2916462 -> 042347e)

2020-08-06 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch build-fdb-couchjs-for-redhat-linux
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 2916462  fixup: Build couch_js for redhat linux
 add 042347e  fixup: Build couch_js for redhat linux

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2916462)
\
 N -- N -- N   refs/heads/build-fdb-couchjs-for-redhat-linux 
(042347e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/couch/rebar.config.script | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)



[couchdb] branch build-fdb-couchjs-for-redhat-linux created (now 2916462)

2020-08-05 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch build-fdb-couchjs-for-redhat-linux
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 2916462  fixup: Build couch_js for redhat linux

This branch includes the following new commits:

 new 2916462  fixup: Build couch_js for redhat linux

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: fixup: Build couch_js for redhat linux

2020-08-05 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch build-fdb-couchjs-for-redhat-linux
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 29164628d924fb80b32875fee1c6937acfe4119e
Author: jiangph 
AuthorDate: Wed Aug 5 15:37:45 2020 +0800

fixup: Build couch_js for redhat linux

When building couch_js in RHEL, there is one error occurring with "undefined
 reference to symbol '_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3'".
This commit is to adjust binding library to address this issue.
---
 src/couch/rebar.config.script | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/couch/rebar.config.script b/src/couch/rebar.config.script
index 80e6bd1..667bb87 100644
--- a/src/couch/rebar.config.script
+++ b/src/couch/rebar.config.script
@@ -118,6 +118,11 @@ end,
 "-DXP_UNIX -I/usr/include/mozjs-60 -I/usr/local/include/mozjs-60 
-std=c++14",
 "-L/usr/local/lib -lmozjs-60 -lm -std=c++14 -lc++"
 };
+{unix, linux} when SMVsn == "60" ->
+{
+"-DXP_UNIX -I/usr/include/mozjs-60 -I/usr/local/include/mozjs-60 
-std=c++14",
+"-L/usr/local/lib -lstdc++ -lmozjs-60 -lm"
+};
 {unix, _} when SMVsn == "60" ->
 {
 "-DXP_UNIX -I/usr/include/mozjs-60 -I/usr/local/include/mozjs-60 
-std=c++14",



[couchdb] branch prototype/fdb-layer updated (51694f7 -> 6c7d203)

2020-05-21 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 51694f7  Bulk docs transaction batching
 add 44935ac  Improve log of permanently deleting databases
 new 6c7d203  Merge pull request #2897 from apache/improve-db-expiration-log

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/fabric/src/fabric2_db_expiration.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[couchdb] 01/01: Merge pull request #2897 from apache/improve-db-expiration-log

2020-05-21 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 6c7d203413d33e074c009e46a9e8122683e9e826
Merge: 51694f7 44935ac
Author: Peng Hui Jiang 
AuthorDate: Thu May 21 14:40:11 2020 +0800

Merge pull request #2897 from apache/improve-db-expiration-log

Improve log of permanently deleting databases

 src/fabric/src/fabric2_db_expiration.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[couchdb] 01/01: Improve log of permanently deleting databases

2020-05-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch improve-db-expiration-log
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 44935aca8fdbf5f38027d6cb3bb11c678b3c9330
Author: jiangph 
AuthorDate: Thu May 21 10:36:31 2020 +0800

Improve log of permanently deleting databases
---
 src/fabric/src/fabric2_db_expiration.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fabric/src/fabric2_db_expiration.erl 
b/src/fabric/src/fabric2_db_expiration.erl
index 3363d24..92f22e7 100644
--- a/src/fabric/src/fabric2_db_expiration.erl
+++ b/src/fabric/src/fabric2_db_expiration.erl
@@ -180,8 +180,8 @@ process_row(DbInfo) ->
 Since = Now - Retention,
 case Since >= timestamp_to_sec(TimeStamp)  of
 true ->
-couch_log:notice("Permanently deleting ~p database with"
-"  timestamp ~p", [DbName, TimeStamp]),
+couch_log:notice("Permanently deleting ~s database with"
+" timestamp ~s", [DbName, TimeStamp]),
 ok = fabric2_db:delete(DbName, [{deleted_at, TimeStamp}]);
 false ->
 ok



[couchdb] branch improve-db-expiration-log created (now 44935ac)

2020-05-20 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch improve-db-expiration-log
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


  at 44935ac  Improve log of permanently deleting databases

This branch includes the following new commits:

 new 44935ac  Improve log of permanently deleting databases

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[couchdb] 01/01: Merge pull request #2857 from apache/background-db-deletion

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 112790829472c50b66d1cd50f78e28a1372909ea
Merge: 968def8 91becc1
Author: Peng Hui Jiang 
AuthorDate: Wed May 13 23:21:58 2020 +0800

Merge pull request #2857 from apache/background-db-deletion

Background database deletion

 src/fabric/include/fabric2.hrl|   1 +
 src/fabric/src/fabric2_db_expiration.erl  | 246 ++
 src/fabric/src/fabric2_sup.erl|  10 +-
 src/fabric/test/fabric2_db_crud_tests.erl | 104 -
 4 files changed, 358 insertions(+), 3 deletions(-)



[couchdb] branch prototype/fdb-layer updated (968def8 -> 1127908)

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 968def8  Fix couch_views updater_running info result
 add 91becc1  background deletion for soft-deleted database
 new 1127908  Merge pull request #2857 from apache/background-db-deletion

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/fabric/include/fabric2.hrl|   1 +
 src/fabric/src/fabric2_db_expiration.erl  | 246 ++
 src/fabric/src/fabric2_sup.erl|  10 +-
 src/fabric/test/fabric2_db_crud_tests.erl | 104 -
 4 files changed, 358 insertions(+), 3 deletions(-)
 create mode 100644 src/fabric/src/fabric2_db_expiration.erl



[couchdb] branch background-db-deletion updated (3d447c6 -> 91becc1)

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 3d447c6  background deletion for soft-deleted database
 add 91becc1  background deletion for soft-deleted database

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3d447c6)
\
 N -- N -- N   refs/heads/background-db-deletion (91becc1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/fabric/src/fabric2_db_expiration.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[couchdb] branch background-db-deletion updated (b6eb006 -> 3d447c6)

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard b6eb006  space
 discard a3b84af  use callback instead
 discard 0e7b08c  address Nick's comment
 discard 2144b30  Improve and add test
 discard 05251ad  Another update
 discard 2c9d219  Update
 discard eacf2b6  background deletion for soft-deleted database
 add 3d447c6  background deletion for soft-deleted database

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b6eb006)
\
 N -- N -- N   refs/heads/background-db-deletion (3d447c6)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:



[couchdb] branch background-db-deletion updated (a3b84af -> b6eb006)

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from a3b84af  use callback instead
 add b6eb006  space

No new revisions were added by this update.

Summary of changes:
 src/fabric/src/fabric2_db_expiration.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[couchdb] branch background-db-deletion updated (0e7b08c -> a3b84af)

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 0e7b08c  address Nick's comment
 add a3b84af  use callback instead

No new revisions were added by this update.

Summary of changes:
 src/fabric/src/fabric2_db_expiration.erl | 45 
 1 file changed, 28 insertions(+), 17 deletions(-)



[couchdb] branch background-db-deletion updated (73bb7db -> 0e7b08c)

2020-05-13 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


omit 73bb7db  address Nick's comment
 add 0e7b08c  address Nick's comment

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (73bb7db)
\
 N -- N -- N   refs/heads/background-db-deletion (0e7b08c)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/fabric/include/fabric2.hrl|  4 --
 src/fabric/src/fabric2_db_expiration.erl  | 98 +--
 src/fabric/test/fabric2_db_crud_tests.erl | 41 +
 3 files changed, 57 insertions(+), 86 deletions(-)



[couchdb] branch background-db-deletion updated (2144b30 -> 73bb7db)

2020-05-12 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


from 2144b30  Improve and add test
 add 73bb7db  address Nick's comment

No new revisions were added by this update.

Summary of changes:
 src/fabric/include/fabric2.hrl|  4 
 src/fabric/src/fabric2_db_expiration.erl  | 28 
 src/fabric/src/fabric2_sup.erl|  2 +-
 src/fabric/test/fabric2_db_crud_tests.erl | 30 --
 4 files changed, 49 insertions(+), 15 deletions(-)



[couchdb] branch background-db-deletion updated (43b0caa -> 2144b30)

2020-05-11 Thread jiangphcn
This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a change to branch background-db-deletion
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


 discard 43b0caa  Improve and add test
 add 2144b30  Improve and add test

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (43b0caa)
\
 N -- N -- N   refs/heads/background-db-deletion (2144b30)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 src/fabric/src/fabric2_db_expiration.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



  1   2   3   4   5   6   7   8   9   >