[GitHub] couchdb-couch pull request #215: Implement couch_file:format_status to log f...

2018-10-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/215


---


[GitHub] couchdb-couch issue #215: Implement couch_file:format_status to log filepath

2018-10-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/215
  
Closing it in favor of https://github.com/apache/couchdb/pull/1601 (merged 
already).


---


[GitHub] couchdb-couch pull request #209: remove compact files on failure

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/209


---


[GitHub] couchdb-couch issue #209: remove compact files on failure

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/209
  
closing this due to inactivity 


---


[GitHub] couchdb-mem3 pull request #12: Add test suite for http endpoints

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-mem3/pull/12


---


[GitHub] couchdb-mem3 issue #12: Add test suite for http endpoints

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-mem3/pull/12
  
stale PR


---


[GitHub] couchdb-couch pull request #92: Refactor test suite for httpd endpoints

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/92


---


[GitHub] couchdb-couch issue #92: Refactor test suite for httpd endpoints

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/92
  
stale PR


---


[GitHub] couchdb-couch-epi issue #6: Implement 'couch_epi:is_defined_by_app/4'

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-epi/pull/6
  
stale PR


---


[GitHub] couchdb-chttpd pull request #65: Refactor test suite for httpd endpoints

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-chttpd/pull/65


---


[GitHub] couchdb-couch-epi pull request #6: Implement 'couch_epi:is_defined_by_app/4'

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch-epi/pull/6


---


[GitHub] couchdb-chttpd issue #65: Refactor test suite for httpd endpoints

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/65
  
stale PR


---


[GitHub] couchdb-chttpd pull request #34: Handle Etag generation in one place

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-chttpd/pull/34


---


[GitHub] couchdb-chttpd issue #34: Handle Etag generation in one place

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/34
  
stale PR


---


[GitHub] couchdb-chttpd pull request #26: Return {error, Reason} for illegal_database...

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-chttpd/pull/26


---


[GitHub] couchdb-chttpd issue #26: Return {error, Reason} for illegal_database_name

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/26
  
stale PR


---


[GitHub] couchdb-chttpd issue #24: Use started apps from test_util:start_applications

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/24
  
stale PR


---


[GitHub] couchdb-chttpd pull request #24: Use started apps from test_util:start_appli...

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-chttpd/pull/24


---


[GitHub] couchdb-couch issue #32: Make sure we load all applications with stats defs

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/32
  
stale PR


---


[GitHub] couchdb-couch pull request #32: Make sure we load all applications with stat...

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/32


---


[GitHub] couchdb-couch issue #208: format process state

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/208
  
stale PR


---


[GitHub] couchdb-couch pull request #208: format process state

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/208


---


[GitHub] couchdb-couch-replicator issue #51: Format gen_server state to remove plain ...

2018-09-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/51
  
stale PR


---


[GitHub] couchdb-couch-replicator pull request #51: Format gen_server state to remove...

2018-09-12 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch-replicator/pull/51


---


[GitHub] couchdb-config pull request #19: Support not persist variants for helper fun...

2018-03-14 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-config/pull/19

Support not persist variants for helper functions

This adds support for specifying Persist argument for the following
helper functions:

 * set_boolean
 * set_integer
 * set_float

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-config 
support-not-persist-variants

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-config/pull/19.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #19


commit 0c6010e4a33f9bd5f6907e886186448f7af7f499
Author: ILYA Khlopotov 
Date:   2018-03-14T13:13:56Z

Support not persist variants for helper functions

This adds support for specifying Persist argument for the following
helper functions:

 * set_boolean
 * set_integer
 * set_float




---


[GitHub] couchdb-oauth pull request #2: Remove couch_crypto

2017-08-01 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-oauth/pull/2

Remove couch_crypto

The crypto:hmac function exists in all the versions of erlang supported by 
CouchDB.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-oauth remove-couch_crypto

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-oauth/pull/2.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2


commit 55d4441ad235e89a1549dc8fd54edb43ee9442a8
Author: ILYA Khlopotov 
Date:   2017-08-01T21:29:50Z

Remove couch_crypto




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-config issue #15: Fix eunit tests

2017-05-19 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-config/pull/15
  
test_util is in monorepository. However we can fix it in separate PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-config pull request #15: Fix eunit tests

2017-05-19 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-config/pull/15#discussion_r117546796
  
--- Diff: test/config_tests.erl ---
@@ -69,34 +67,36 @@ setup({persistent, Chain}) ->
 
 setup(Chain) ->
 ok = application:set_env(config, ini_files, Chain),
-test_util:start_applications(?DEPS).
+test_util:start_applications([config]).
 
 
 setup_empty() ->
 setup([]).
 
 
 setup_config_listener() ->
-setup(),
-spawn_config_listener().
+Apps = setup(),
+Pid = spawn_config_listener(),
+{Apps, Pid}.
 
 setup_config_notifier(Subscription) ->
-setup(),
-spawn_config_notifier(Subscription).
+Apps = setup(),
+Pid = spawn_config_notifier(Subscription),
+{Apps, Pid}.
 
 
-teardown(Pid) when is_pid(Pid) ->
+teardown({Apps, Pid}) when is_pid(Pid) ->
 catch exit(Pid, kill),
-teardown(undefined);
+teardown(Apps);
 
-teardown(_) ->
-[application:stop(App) || App <- ?DEPS].
+teardown(Apps) when is_list(Apps) ->
+test_util:stop_applications(Apps).
--- End diff --

test_util is part of monorepository


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-config pull request #15: Fix eunit tests

2017-05-19 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-config/pull/15#discussion_r117546645
  
--- Diff: test/config_tests.erl ---
@@ -69,34 +67,36 @@ setup({persistent, Chain}) ->
 
 setup(Chain) ->
 ok = application:set_env(config, ini_files, Chain),
-test_util:start_applications(?DEPS).
+test_util:start_applications([config]).
--- End diff --

test_util is in monorepository


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #241: Improve compaction task status updates

2017-03-30 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/241#discussion_r109049344
  
--- Diff: src/couch_db_updater.erl ---
@@ -1323,12 +1326,82 @@ bind_id_tree(Db, Fd, State) ->
 Db#db{id_tree=IdBtree}.
 
 
-sort_meta_data(Db0) ->
-{ok, Ems} = couch_emsort:merge(Db0#db.id_tree),
-Db0#db{id_tree=Ems}.
+sort_meta_data(Db0, DocCount) ->
+couch_task_status:update([
+{phase, sort_ids_init},
+{total_changes, DocCount},
+{changes_done, 0},
+{progress, 0}
+]),
+Ems0 = Db0#db.id_tree,
+Options = [
+{event_cb, fun emsort_cb/3},
+{event_st, {init, 0, 0}}
+],
+Ems1 = couch_emsort:set_options(Ems0, Options),
+{ok, Ems2} = couch_emsort:merge(Ems1),
+Db0#db{id_tree=Ems2}.
+
+
+emsort_cb(_Ems, {merge, chain}, {init, Copied, Nodes}) ->
+{init, Copied, Nodes + 1};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) when Copied >= 1000 ->
--- End diff --

Yes I mean that it would be better to have a define. Like ?UPDATE_FREQ or 
?BATCH_SIZE or something.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #241: Improve compaction task status updates

2017-03-30 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/241#discussion_r109013211
  
--- Diff: src/couch_db_updater.erl ---
@@ -1323,12 +1326,82 @@ bind_id_tree(Db, Fd, State) ->
 Db#db{id_tree=IdBtree}.
 
 
-sort_meta_data(Db0) ->
-{ok, Ems} = couch_emsort:merge(Db0#db.id_tree),
-Db0#db{id_tree=Ems}.
+sort_meta_data(Db0, DocCount) ->
+couch_task_status:update([
+{phase, sort_ids_init},
+{total_changes, DocCount},
+{changes_done, 0},
+{progress, 0}
+]),
+Ems0 = Db0#db.id_tree,
+Options = [
+{event_cb, fun emsort_cb/3},
+{event_st, {init, 0, 0}}
+],
+Ems1 = couch_emsort:set_options(Ems0, Options),
+{ok, Ems2} = couch_emsort:merge(Ems1),
+Db0#db{id_tree=Ems2}.
+
+
+emsort_cb(_Ems, {merge, chain}, {init, Copied, Nodes}) ->
+{init, Copied, Nodes + 1};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) when Copied >= 1000 ->
+update_compact_task(Copied + 1),
+{init, 0, Nodes};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) ->
+{init, Copied + 1, Nodes};
+emsort_cb(Ems, {merge_start, reverse}, {init, Copied, Nodes}) ->
+BBChunkSize = couch_emsort:get_bb_chunk_size(Ems),
+
+% Subtract one because we already finished the first
+% iteration when we were counting the number of nodes
+% in the backbone.
+Iters = calculate_sort_iters(Nodes, BBChunkSize, 0) - 1,
+
+% Compaction retries mean we may have copied more than
+% doc count rows. This accounts for that by using the
+% number we've actually copied.
+[PrevCopied] = couch_task_status:get([changes_done]),
+TotalCopied = PrevCopied + Copied,
+
+couch_task_status:update([
+{phase, sort_ids},
+{total_changes, Iters * TotalCopied},
+{changes_done, 0},
+{progress, 0}
+]),
+0;
+
+emsort_cb(_Ems, row_copy, Copied) when is_integer(Copied), Copied > 1000 ->
--- End diff --

Magic constant 1000.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #241: Improve compaction task status updates

2017-03-30 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/241#discussion_r109047926
  
--- Diff: src/couch_db_updater.erl ---
@@ -1323,12 +1326,82 @@ bind_id_tree(Db, Fd, State) ->
 Db#db{id_tree=IdBtree}.
 
 
-sort_meta_data(Db0) ->
-{ok, Ems} = couch_emsort:merge(Db0#db.id_tree),
-Db0#db{id_tree=Ems}.
+sort_meta_data(Db0, DocCount) ->
+couch_task_status:update([
+{phase, sort_ids_init},
+{total_changes, DocCount},
+{changes_done, 0},
+{progress, 0}
+]),
+Ems0 = Db0#db.id_tree,
+Options = [
+{event_cb, fun emsort_cb/3},
+{event_st, {init, 0, 0}}
+],
+Ems1 = couch_emsort:set_options(Ems0, Options),
+{ok, Ems2} = couch_emsort:merge(Ems1),
+Db0#db{id_tree=Ems2}.
+
+
+emsort_cb(_Ems, {merge, chain}, {init, Copied, Nodes}) ->
+{init, Copied, Nodes + 1};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) when Copied >= 1000 ->
+update_compact_task(Copied + 1),
+{init, 0, Nodes};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) ->
+{init, Copied + 1, Nodes};
+emsort_cb(Ems, {merge_start, reverse}, {init, Copied, Nodes}) ->
--- End diff --

It looks like we wouldn't have a progress updates for the second pass. Is 
it intentional?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #241: Improve compaction task status updates

2017-03-30 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/241#discussion_r109014150
  
--- Diff: src/couch_db_updater.erl ---
@@ -1323,12 +1326,82 @@ bind_id_tree(Db, Fd, State) ->
 Db#db{id_tree=IdBtree}.
 
 
-sort_meta_data(Db0) ->
-{ok, Ems} = couch_emsort:merge(Db0#db.id_tree),
-Db0#db{id_tree=Ems}.
+sort_meta_data(Db0, DocCount) ->
+couch_task_status:update([
+{phase, sort_ids_init},
+{total_changes, DocCount},
+{changes_done, 0},
+{progress, 0}
+]),
+Ems0 = Db0#db.id_tree,
+Options = [
+{event_cb, fun emsort_cb/3},
+{event_st, {init, 0, 0}}
+],
+Ems1 = couch_emsort:set_options(Ems0, Options),
+{ok, Ems2} = couch_emsort:merge(Ems1),
+Db0#db{id_tree=Ems2}.
+
+
+emsort_cb(_Ems, {merge, chain}, {init, Copied, Nodes}) ->
+{init, Copied, Nodes + 1};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) when Copied >= 1000 ->
+update_compact_task(Copied + 1),
+{init, 0, Nodes};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) ->
+{init, Copied + 1, Nodes};
+emsort_cb(Ems, {merge_start, reverse}, {init, Copied, Nodes}) ->
--- End diff --

I noticed that we can also have `{merge_start, forward}` 
[event](https://github.com/apache/couchdb-couch/blob/1db1337301a7c897be41e13cd328270509008478/src/couch_emsort.erl#L246:L252).
 Should we handle it as well?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #241: Improve compaction task status updates

2017-03-30 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/241#discussion_r109013180
  
--- Diff: src/couch_db_updater.erl ---
@@ -1323,12 +1326,82 @@ bind_id_tree(Db, Fd, State) ->
 Db#db{id_tree=IdBtree}.
 
 
-sort_meta_data(Db0) ->
-{ok, Ems} = couch_emsort:merge(Db0#db.id_tree),
-Db0#db{id_tree=Ems}.
+sort_meta_data(Db0, DocCount) ->
+couch_task_status:update([
+{phase, sort_ids_init},
+{total_changes, DocCount},
+{changes_done, 0},
+{progress, 0}
+]),
+Ems0 = Db0#db.id_tree,
+Options = [
+{event_cb, fun emsort_cb/3},
+{event_st, {init, 0, 0}}
+],
+Ems1 = couch_emsort:set_options(Ems0, Options),
+{ok, Ems2} = couch_emsort:merge(Ems1),
+Db0#db{id_tree=Ems2}.
+
+
+emsort_cb(_Ems, {merge, chain}, {init, Copied, Nodes}) ->
+{init, Copied, Nodes + 1};
+emsort_cb(_Ems, row_copy, {init, Copied, Nodes}) when Copied >= 1000 ->
--- End diff --

Magic constant 1000.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview pull request #72: Fix end-point _local_docs

2017-03-21 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch-mrview/pull/72#discussion_r107329994
  
--- Diff: src/couch_mrview.erl ---
@@ -653,6 +653,18 @@ make_meta(Args, UpdateSeq, Base) ->
 end.
 
 
+get_total_rows(#db{local_tree = LocalTree} = Db, #mrargs{extra = Extra}) ->
+case couch_util:get_value(namespace, Extra) of
+<<"_local">> ->
+FoldFun = fun(_, _, Acc) -> {ok, Acc + 1} end,
+{ok, _, Total} = couch_btree:foldl(LocalTree, FoldFun, 0),
--- End diff --

My concern is that if we traverse the btree we would count deleted docs as 
well. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview pull request #70: Fix undef error on empty list functio...

2017-03-15 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch-mrview/pull/70#discussion_r106313882
  
--- Diff: src/couch_mrview_show.erl ---
@@ -426,4 +424,31 @@ should_apply_headers_with_merge_overwrite() ->
 ?assertEqual({NewHeaders}, JsonHeaders)
 end).
 
+
+send_list_row_test_() -> {
+"Ensure send_list_row returns a valid response on end or error",
+{setup, fun setup/0, fun(_) -> meck:unload() end, [
+should_return_valid_response(fun(_, _) -> [<<"end">>, [], []] end, 
req),
--- End diff --

The test doesn't print arguments. The following works:
```
send_list_row_test_() ->
Cases = couch_tests_combinatorics:product([
[
{"[<<\"end\">>, [], []]", fun(_, _) -> [<<"end">>, [], []] end},
{"[<<\"end\">>, []]", fun(_, _) -> [<<"end">>, []] end},
{"throw(timeout)", fun(_, _) -> throw(timeout) end}
],
[
req,
undefined]
]),
{
"Ensure send_list_row returns a valid response on end or error",
{setup, fun setup/0, fun(_) -> meck:unload() end, [
{
lists:flatten(io_lib:format("~s -- ~p", [N, R])),
should_return_valid_response(F, R)
} || [{N, F}, R] <- Cases
]}
}.
```
```
Ensure send_list_row returns a valid response on end or error
  couch_mrview_show:460: should_return_valid_response ([<<"end">>, [], []] 
-- req)...[0.117 s] ok
  couch_mrview_show:460: should_return_valid_response ([<<"end">>, [], []] 
-- undefined)...[0.007 s] ok
  couch_mrview_show:460: should_return_valid_response ([<<"end">>, []] -- 
req)...[0.007 s] ok
  couch_mrview_show:460: should_return_valid_response ([<<"end">>, []] -- 
undefined)...[0.007 s] ok
  couch_mrview_show:460: should_return_valid_response (throw(timeout) -- 
req)...[0.007 s] ok
  couch_mrview_show:460: should_return_valid_response (throw(timeout) -- 
undefined)...[0.010 s] ok
  [done in 0.172 s]
===
  All 6 tests passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #239: An ETS based couch_lru

2017-03-15 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/239#discussion_r106264428
  
--- Diff: src/couch_lru.erl ---
@@ -16,48 +16,57 @@
 -include_lib("couch/include/couch_db.hrl").
 
 new() ->
-{gb_trees:empty(), dict:new()}.
-
-insert(DbName, {Tree0, Dict0}) ->
-Lru = erlang:now(),
-{gb_trees:insert(Lru, DbName, Tree0), dict:store(DbName, Lru, Dict0)}.
-
-update(DbName, {Tree0, Dict0}) ->
-case dict:find(DbName, Dict0) of
-{ok, Old} ->
-New = erlang:now(),
-Tree = gb_trees:insert(New, DbName, gb_trees:delete(Old, Tree0)),
-Dict = dict:store(DbName, New, Dict0),
-{Tree, Dict};
-error ->
-% We closed this database before processing the update.  Ignore
-{Tree0, Dict0}
+Updates = ets:new(couch_lru_updates, [ordered_set]),
+Dbs = ets:new(couch_lru_dbs, [set]),
+{0, Updates, Dbs}.
+
+insert(DbName, {Count, Updates, Dbs}) ->
+update(DbName, {Count, Updates, Dbs}).
+
+update(DbName, {Count, Updates, Dbs}) ->
--- End diff --

If we use update_counter we don't have to pass Count around.
Also  `true = ets:insert(Updates, {{Count, DbName}});` happen in both 
branches so could be moved outside of a case statement.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #239: An ETS based couch_lru

2017-03-15 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/239#discussion_r106263970
  
--- Diff: src/couch_lru.erl ---
@@ -16,48 +16,57 @@
 -include_lib("couch/include/couch_db.hrl").
 
 new() ->
-{gb_trees:empty(), dict:new()}.
-
-insert(DbName, {Tree0, Dict0}) ->
-Lru = erlang:now(),
-{gb_trees:insert(Lru, DbName, Tree0), dict:store(DbName, Lru, Dict0)}.
-
-update(DbName, {Tree0, Dict0}) ->
-case dict:find(DbName, Dict0) of
-{ok, Old} ->
-New = erlang:now(),
-Tree = gb_trees:insert(New, DbName, gb_trees:delete(Old, Tree0)),
-Dict = dict:store(DbName, New, Dict0),
-{Tree, Dict};
-error ->
-% We closed this database before processing the update.  Ignore
-{Tree0, Dict0}
+Updates = ets:new(couch_lru_updates, [ordered_set]),
+Dbs = ets:new(couch_lru_dbs, [set]),
+{0, Updates, Dbs}.
+
+insert(DbName, {Count, Updates, Dbs}) ->
+update(DbName, {Count, Updates, Dbs}).
+
+update(DbName, {Count, Updates, Dbs}) ->
--- End diff --

This possibly could be replaced with:
```
case ets:update_counter(Dbs, DbName, 1, {DbName, Count}) of
Count -> 
true = ets:insert(Updates, {{Count, DbName}});
NewCount ->
true = ets:delete(Updates, {NewCount - 1, DbName}),
true = ets:insert(Updates, {{Count, DbName}})
   end,
  {Count +1, Updates, Dbs}.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #63: Prevent change feeds from being stuck

2017-03-10 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/63
  
Nice. +1



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #234: Fix initial accumulator value for builtin_s...

2017-03-08 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-couch/pull/234

Fix initial accumulator value for builtin_sum_rows

This a fixup for https://github.com/apache/couchdb-couch/pull/229.
The initial value for accumulator suppose to be 0. Since the result of
sum and count is integer. The problem was discovered by dialyzer.

COUCHDB-3305

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch 
70794-fix-initial-acc-for-builtin_sum_rows

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch/pull/234.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #234


commit 1f152daaac23dc96132139fb532786f77becdd64
Author: ILYA Khlopotov 
Date:   2017-03-08T20:24:46Z

Fix initial accumulator value for builtin_sum_rows

This a fixup for https://github.com/apache/couchdb-couch/pull/229.
The initial value for accumulator suppose to be 0. Since the result of
sum and count is integer. The problem was discovered by dialyzer.

COUCHDB-3305




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #105: Add documentation for the new `max_http_re...

2017-03-08 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-documentation/pull/105
  
@nickva: Please remove old documentation from couchdb section.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd issue #156: Introduce max_http_request_size to replace max_do...

2017-03-07 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/156
  
> Wonder if we should use the httpd config section since 
max_http_request_size related more the HTTP layer than db core.

I agree that `couchdb` is not the most obvious section where the one would 
look for it.
However due to the need to change `couch_httpd` there is a tough question. 
What section to choose:
 1. chttpd section for both http stacks 
 2. httpd section for both http stacks
 3. chttpd section for clustered interface and httpd section for 
non-clustered


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd issue #156: Introduce max_http_request_size to replace max_do...

2017-03-07 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/156
  
We should update following places for consistency.
- 
[couch_httpd_external.erl:67](https://github.com/apache/couchdb-couch/blob/a468b0db6f1a9795b32e26c34b340df4d51f31b0/src/couch_httpd_external.erl#L67)
- 
[couch_httpd.erl:454](https://github.com/apache/couchdb-couch/blob/bfed196d4cade50be6864db71611f0b909cc919b/src/couch_httpd.erl#L454)
- 
[couch_httpd.erl:580](https://github.com/apache/couchdb-couch/blob/bfed196d4cade50be6864db71611f0b909cc919b/src/couch_httpd.erl#L580)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #60: Remove unused mp_parse_doc function from...

2017-03-07 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/60
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-03-06 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/229
  
+1. All tests pass locally
```
Running test function(s):
  couch_query_servers:builtin_sum_rows_negative_test/0
  couch_query_servers:sum_values_negative_test/0
 EUnit 
couch_query_servers: sum_values_negative_test...[0.002 s] ok
couch_query_servers: builtin_sum_rows_negative_test...ok
===
  All 2 tests passed.
```
```
==> couch (eunit)
...
===
  All 792 tests passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #229: Return error row instead of crashing

2017-03-01 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/229#discussion_r103786495
  
--- Diff: src/couch_query_servers.erl ---
@@ -169,6 +178,19 @@ sum_values(Value, Acc) when is_number(Value), 
is_list(Acc) ->
 sum_arrays(Acc, [Value]);
 sum_values(Value, Acc) when is_list(Value), is_number(Acc) ->
 sum_arrays([Acc], Value);
+sum_values({Props}, Acc) ->
+case lists:keyfind(<<"error">>, 1, Props) of
--- End diff --

I don't like the fact that we are passing error in the payload. This forces 
us to iterate through Props.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #229: Return error row instead of crashing

2017-03-01 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/229#discussion_r103782695
  
--- Diff: src/couch_query_servers.erl ---
@@ -142,25 +142,34 @@ os_rereduce(Lang, OsRedSrcs, KVs) ->
 builtin_reduce(_Re, [], _KVs, Acc) ->
 {ok, lists:reverse(Acc)};
 builtin_reduce(Re, [<<"_sum",_/binary>>|BuiltinReds], KVs, Acc) ->
-Sum = builtin_sum_rows(KVs),
+Sum = builtin_sum_rows(KVs, []),
 builtin_reduce(Re, BuiltinReds, KVs, [Sum|Acc]);
 builtin_reduce(reduce, [<<"_count",_/binary>>|BuiltinReds], KVs, Acc) ->
 Count = length(KVs),
 builtin_reduce(reduce, BuiltinReds, KVs, [Count|Acc]);
 builtin_reduce(rereduce, [<<"_count",_/binary>>|BuiltinReds], KVs, Acc) ->
-Count = builtin_sum_rows(KVs),
+Count = builtin_sum_rows(KVs, []),
 builtin_reduce(rereduce, BuiltinReds, KVs, [Count|Acc]);
 builtin_reduce(Re, [<<"_stats",_/binary>>|BuiltinReds], KVs, Acc) ->
 Stats = builtin_stats(Re, KVs),
 builtin_reduce(Re, BuiltinReds, KVs, [Stats|Acc]).
 
-builtin_sum_rows(KVs) ->
-lists:foldl(fun([_Key, Value], Acc) -> sum_values(Value, Acc) end, 0, 
KVs).
 
-sum_values({Props}, 0) ->
-{Props};
-sum_values({Props}, {AccProps}) ->
-{sum_objects(lists:sort(Props), lists:sort(AccProps))};
+builtin_sum_rows([], Acc) ->
+Acc;
+builtin_sum_rows([[Key, Value] | RestKVs], Acc) ->
--- End diff --

Compilation warning:
```
src/couch/src/couch_query_servers.erl:160: Warning: variable 'Key' is unused
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #229: Return error row instead of crashing

2017-03-01 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/229#discussion_r103788697
  
--- Diff: src/couch_query_servers.erl ---
@@ -142,25 +142,34 @@ os_rereduce(Lang, OsRedSrcs, KVs) ->
 builtin_reduce(_Re, [], _KVs, Acc) ->
 {ok, lists:reverse(Acc)};
 builtin_reduce(Re, [<<"_sum",_/binary>>|BuiltinReds], KVs, Acc) ->
-Sum = builtin_sum_rows(KVs),
+Sum = builtin_sum_rows(KVs, []),
 builtin_reduce(Re, BuiltinReds, KVs, [Sum|Acc]);
 builtin_reduce(reduce, [<<"_count",_/binary>>|BuiltinReds], KVs, Acc) ->
 Count = length(KVs),
 builtin_reduce(reduce, BuiltinReds, KVs, [Count|Acc]);
 builtin_reduce(rereduce, [<<"_count",_/binary>>|BuiltinReds], KVs, Acc) ->
-Count = builtin_sum_rows(KVs),
+Count = builtin_sum_rows(KVs, []),
 builtin_reduce(rereduce, BuiltinReds, KVs, [Count|Acc]);
 builtin_reduce(Re, [<<"_stats",_/binary>>|BuiltinReds], KVs, Acc) ->
 Stats = builtin_stats(Re, KVs),
 builtin_reduce(Re, BuiltinReds, KVs, [Stats|Acc]).
 
-builtin_sum_rows(KVs) ->
-lists:foldl(fun([_Key, Value], Acc) -> sum_values(Value, Acc) end, 0, 
KVs).
 
-sum_values({Props}, 0) ->
-{Props};
-sum_values({Props}, {AccProps}) ->
-{sum_objects(lists:sort(Props), lists:sort(AccProps))};
+builtin_sum_rows([], Acc) ->
+Acc;
+builtin_sum_rows([[Key, Value] | RestKVs], Acc) ->
+try sum_values(Value, Acc) of
+NewAcc ->
+builtin_sum_rows(RestKVs, NewAcc)
+catch
+throw:{builtin_reduce_error, Obj} ->
+Obj;
+throw:{invalid_value, Reason, Cause} ->
+{[{<<"error">>, <<"builtin_reduce_error">>},
--- End diff --

Why we have to handle the same error twice. Am I understanding it 
correctly? 
1. we catch invalid_value
2. we return `{[{<<"error">>, ...}]}`
3. on the outer recursion call we go into sum_values
4. sum_values detects the `{[{<<"error">>, ...}]}` and throws 
`{builtin_reduce_error,...`
5. we catch `{builtin_reduce_error,...` and return Obj which is our 
`{[{<<"error">>, ...}]}`

Sounds complicated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #57: Restore adding some jitter-ed sleep to s...

2017-02-28 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/57
  
+1 
```
Running test function(s):
  couch_replicator_manager:scan_dbs_test_/0
 EUnit 
couch_replicator_manager:1051: t_resume_db_shard...[0.317 s] ok
couch_replicator_manager:1064: t_sleep_based_on_count...[0.206 s] ok
===
  All 2 tests passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #229: Return error row instead of crashing

2017-02-21 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/229
  
What about other kinds of errors? Should we consider returning errors as:
```
"value": {
"key": [],
"value": ,
"errors": {
   "builtin_reduce": [
  "The _sum function requires that map values 
be numbers, arrays of numbers, or objects, not '[{[{<<\"b\">>,\n",
  "(whatever other errors we might have)" 
 ]
}
}
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #228: Couchdb 3298 improve couch btree chunkify

2017-02-16 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/228
  
Tested manually with the following:
```
LL = couch_btree:chunkify(
   [{list_to_binary(couch_util:to_hex(crypto:rand_bytes(10))), 
binary:copy(<<"x">>, 1300)}
   || _ <- lists:seq(1, 10)]).
length(LL).

 Generator = fun(Size, N) ->
   [{list_to_binary(couch_util:to_hex(crypto:rand_bytes(10))), 
binary:copy(<<"x">>, Size)}
  || _ <- lists:seq(1, N)]
 end.

 LL = couch_btree:chunkify(Generator(1300, 3)).
 [Last | _] = lists:reverse(LL).
 [{"Number of chunks", length(LL)}, {"Elements in last chunk", 
length(Last)}].
```

The output without this change is:
```
[
  {"Number of chunks",5},
  {"Elements in last chunk",2}
]
```

The output with this change is:
```
[
  {"Number of chunks",1},
  {"Elements in last chunk",3}
]
```

+1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request #155: Mock config module in tests

2017-02-09 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-chttpd/pull/155

Mock config module in tests

The tests in chttpd_db_bulk_get_test do not start config app.
The change in https://github.com/apache/couchdb-couch/pull/226
introduces call to config app.
Make sure we mock config so the tests pass.

COUCHDB-3293

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-chttpd couchdb-3293

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-chttpd/pull/155.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #155


commit fdfca9f0af73483fd5c4150ad46be1c79cd09165
Author: ILYA Khlopotov 
Date:   2017-02-09T21:36:39Z

Mock config module in tests

The tests in chttpd_db_bulk_get_test do not start config app.
The change in https://github.com/apache/couchdb-couch/pull/226
introduces call to config app.
Make sure we mock config so the tests pass.

COUCHDB-3293




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #226: Allow limiting length of document ID

2017-02-09 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/226
  
+1. tests pass locally
```
Running test function(s):
  couch_doc_json_tests:json_doc_test_/0
  couch_doc_tests:validate_docid_test_/0
 EUnit 
couch_doc_tests:89: validate_docid_test_...[0.003 s] ok
couch_doc_tests:90: validate_docid_test_...ok
couch_doc_tests:91: validate_docid_test_...ok
couch_doc_tests:92: validate_docid_test_...[0.001 s] ok
couch_doc_tests:93: validate_docid_test_...ok
couch_doc_tests:95: validate_docid_test_...ok
couch_doc_tests:97: validate_docid_test_...ok
couch_doc_tests:99: validate_docid_test_...ok
couch_doc_tests:101: validate_docid_test_...ok
couch_doc_tests:103: validate_docid_test_...ok
couch_doc_tests:105: validate_docid_test_...ok
Document from JSON
  couch_doc_json_tests:168: from_json_success_cases (Return an empty 
document for an empty JSON object.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Parses document 
ids.)...ok
  couch_doc_json_tests:168: from_json_success_cases (_design/document 
ids.)...ok
  couch_doc_json_tests:168: from_json_success_cases (_local/document 
ids.)...ok
  couch_doc_json_tests:168: from_json_success_cases (_rev stored in 
revs.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Non underscore 
prefixed fields stored in body.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Attachments are parsed 
correctly.)...[0.011 s] ok
  couch_doc_json_tests:168: from_json_success_cases (_deleted controls the 
deleted field.)...ok
  couch_doc_json_tests:168: from_json_success_cases ({"_deleted": false} is 
ok.)...ok
  couch_doc_json_tests:168: from_json_success_cases (_revisions attribute 
are preferred to _rev.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Drops _revs_info.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Drops _local_seq.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Drops _conflicts.)...ok
  couch_doc_json_tests:168: from_json_success_cases (Drops 
_deleted_conflicts.)...ok
  couch_doc_json_tests:239: from_json_error_cases (arrays are invalid)...ok
  couch_doc_json_tests:239: from_json_error_cases (integers are 
invalid)...ok
  couch_doc_json_tests:239: from_json_error_cases (literals are 
invalid)...ok
  couch_doc_json_tests:239: from_json_error_cases (Document id must be a 
string.)...ok
  couch_doc_json_tests:239: from_json_error_cases (Disallow arbitrary 
underscore prefixed docids.)...ok
  couch_doc_json_tests:239: from_json_error_cases (_rev must be a 
string)...ok
  couch_doc_json_tests:239: from_json_error_cases (_rev must be %d-%s)...ok
  couch_doc_json_tests:245: from_json_error_cases (Error if _rev's integer 
expection is broken.)...ok
  couch_doc_json_tests:239: from_json_error_cases (_revisions.start must be 
an integer.)...ok
  couch_doc_json_tests:239: from_json_error_cases (_revions.ids must be a 
list.)...ok
  couch_doc_json_tests:239: from_json_error_cases (Revision ids must be 
strings.)...ok
  couch_doc_json_tests:239: from_json_error_cases (Underscore prefix fields 
are reserved.)...ok
  [done in 0.088 s]
Document to JSON
  couch_doc_json_tests:400: to_json_success_cases (Empty docs are {"_id": 
""})...ok
  couch_doc_json_tests:400: to_json_success_cases (_id is added.)...ok
  couch_doc_json_tests:400: to_json_success_cases (_rev is added.)...ok
  couch_doc_json_tests:402: to_json_success_cases (_revisions include with 
revs option)...ok
  couch_doc_json_tests:400: to_json_success_cases (Arbitrary fields are 
added.)...ok
  couch_doc_json_tests:400: to_json_success_cases (Deleted docs no longer 
drop body members.)...ok
  couch_doc_json_tests:400: to_json_success_cases (_revs_info field is 
added correctly.)...ok
  couch_doc_json_tests:400: to_json_success_cases (_local_seq is added as 
an integer.)...ok
  couch_doc_json_tests:400: to_json_success_cases (_conflicts is added as 
an array of strings.)...ok
  couch_doc_json_tests:400: to_json_success_cases (_deleted_conflicsts is 
added as an array of strings.)...ok
  couch_doc_json_tests:400: to_json_success_cases (Attachments attached as 
stubs only include a length.)...ok
  couch_doc_json_tests:402: to_json_success_cases (Attachments included 
inline with attachments option.)...ok
  [done in 0.036 s]
===
  All 49 tests passed.
``` 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #87: Add Else Clause For Embed Doc

2017-02-09 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/87
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #86: Return Error When Workers Crash

2017-02-09 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/86
  
I agree with @nickva. Let's leave replicator problem for the latter. +1 
from me. The test doesn't test the changed line but it is useful anyway. Tests 
pass locally.
```
Running test function(s):
  fabric_doc_open_revs:open_doc_revs_test_/0
 EUnit 
fabric_doc_open_revs:333: check_empty_response_not_quorum...[0.008 s] ok
fabric_doc_open_revs:341: check_basic_response...[0.009 s] ok
fabric_doc_open_revs:349: check_finish_quorum...[0.002 s] ok
fabric_doc_open_revs:361: check_finish_quorum_newer...[0.002 s] ok
fabric_doc_open_revs:378: check_no_quorum_on_second...ok
fabric_doc_open_revs:392: check_done_on_third...ok
fabric_doc_open_revs:405: check_specific_revs_first_msg...ok
fabric_doc_open_revs:415: check_revs_done_on_agreement...ok
fabric_doc_open_revs:425: check_latest_true...ok
fabric_doc_open_revs:436: check_ancestor_counted_in_quorum...ok
fabric_doc_open_revs:453: check_not_found_counts_for_descendant...ok
fabric_doc_open_revs:470: check_worker_error_skipped...ok
fabric_doc_open_revs:484: check_quorum_only_counts_valid_responses...ok
fabric_doc_open_revs:498: check_empty_list_when_no_workers_reply...ok 
<-
fabric_doc_open_revs:512: 
check_not_found_replies_are_removed_when_doc_found...ok
fabric_doc_open_revs:519: 
check_not_found_returned_when_one_of_docs_not_found...ok
fabric_doc_open_revs:526: check_not_found_returned_when_doc_not_found...ok
===
  All 17 tests passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd issue #154: Add Error Clause For fabric:open_revs calls

2017-02-09 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-chttpd/pull/154
  
+1. tests pass locally
```
Running test function(s):
  chttpd_open_revs_error_test:open_revs_error_test_/0
 EUnit 
open revs error tests
  chttpd_open_revs_error_test:76: 
should_return_503_error_for_open_revs_get...ok
  chttpd_open_revs_error_test:99: 
should_return_503_error_for_open_revs_post_form...ok
  [done in 0.930 s]
===
  All 2 tests passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #227: Add test_request:delete/3

2017-02-08 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/227
  
@eiri: done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #227: Add test_request:delete/3

2017-02-08 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/227#discussion_r100145299
  
--- Diff: src/test_request.erl ---
@@ -51,6 +51,9 @@ delete(Url) ->
 delete(Url, Opts) ->
 request(delete, Url, [], [], Opts).
--- End diff --

@eiri: I used the same approach as in other functions get/post/put. We just 
call request from there. Personally I prefer the approach you suggest. Should I 
refactor all of them for consistency? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #227: Add test_request:delete/3

2017-02-08 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-couch/pull/227

Add test_request:delete/3

Sometimes it useful to be able to pass headers in test case to a delete 
request. 
Adding delete/3 to be able to do so.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch 
add-test_requet_delete_3

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch/pull/227.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #227


commit b868390528d6068c3cc837f8de8d5cfee948b285
Author: ILYA Khlopotov 
Date:   2017-02-08T18:47:58Z

Add test_request:delete/3




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator pull request #51: Format gen_server state to remove...

2017-02-08 Thread iilyak
Github user iilyak commented on a diff in the pull request:


https://github.com/apache/couchdb-couch-replicator/pull/51#discussion_r100128076
  
--- Diff: src/couch_replicator.erl ---
@@ -600,8 +562,23 @@ terminate_cleanup(State) ->
 
 
 format_status(_Opt, [_PDict, State]) ->
-[{data, [{"State", state_strip_creds(State)}]}].
-
+Rep = 
couch_replicator_utils:format_rep_record(State#rep_state.rep_details),
+[{data, [
+{"State", [{rep_details, Rep} | ?from_record(rep_state, State, [
+session_id,
+start_seq,
+committed_seq,
+current_through_seq,
+%%seqs_in_progress = [],
--- End diff --

I'll remover it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator pull request #51: Format gen_server state to remove...

2017-02-08 Thread iilyak
Github user iilyak commented on a diff in the pull request:


https://github.com/apache/couchdb-couch-replicator/pull/51#discussion_r100128054
  
--- Diff: src/couch_replicator.erl ---
@@ -1035,3 +1012,39 @@ rep_stats(State) ->
 {doc_write_failures, 
couch_replicator_stats:doc_write_failures(Stats)},
 {checkpointed_source_seq, CommittedSeq}
 ].
+
+-ifdef(TEST).
+
+-include_lib("eunit/include/eunit.hrl").
+
+format_status_test() ->
+S = 
"https://user_foo:top_secret@account_bar1.cloudant.com/database_baz/";,
+T = 
"https://user_foo:top_secret@account_bar2.cloudant.com/baz_backup/";,
+Rep0 = list_to_tuple([rep | record_info(fields, rep)]),
+State0 = list_to_tuple([rep_state | record_info(fields, rep_state)]),
+Rep = Rep0#rep{source = #httpdb{url = S}, target = #httpdb{url = T}},
+State = State0#rep_state{rep_details = Rep},
+?assertEqual([{data, [{"State", [
+{rep_details,[
+
{source,"https://user_foo:*@account_bar1.cloudant.com/database_baz/"},
--- End diff --

I'll fix it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #51: Format gen_server state to remove plain ...

2017-02-08 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/51
  
> @tonysun83: 1) How are we determining which fields to leave in vs leave 
out when we're calling ?format_record 
If the field provides useful information which would help us to correlate 
the event with other events in the log we do log it. Otherwise we leave it out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #51: Format gen_server state to remove plain ...

2017-02-08 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/51
  
@tonysun83: Unfortunately there is no way to solve the problem with Last 
Message without changing the way we pass credentials. I would propose to tackle 
the remaining issue in a separate PR. This work should significantly reduce the 
number of times we leak credentials. It also would reduce the amount of data we 
pass to logger process. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview pull request #65: Refactor mrview_index get

2017-02-07 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch-mrview/pull/65#discussion_r99859905
  
--- Diff: src/couch_mrview_index.erl ---
@@ -23,84 +23,80 @@
 -include_lib("couch_mrview/include/couch_mrview.hrl").
 
 
-get(Property, State) ->
-case Property of
-db_name ->
-State#mrst.db_name;
-idx_name ->
-State#mrst.idx_name;
-signature ->
-State#mrst.sig;
-update_seq ->
-State#mrst.update_seq;
-purge_seq ->
-State#mrst.purge_seq;
-update_options ->
-Opts = State#mrst.design_opts,
-IncDesign = couch_util:get_value(<<"include_design">>, Opts, 
false),
-LocalSeq = couch_util:get_value(<<"local_seq">>, Opts, false),
-SeqIndexed = couch_util:get_value(<<"seq_indexed">>, Opts, 
false),
-KeySeqIndexed = couch_util:get_value(<<"keyseq_indexed">>, 
Opts, false),
-if IncDesign -> [include_design]; true -> [] end
-++ if LocalSeq -> [local_seq]; true -> [] end
-++ if KeySeqIndexed -> [keyseq_indexed]; true -> [] end
-++ if SeqIndexed -> [seq_indexed]; true -> [] end;
-fd ->
-State#mrst.fd;
-language ->
-State#mrst.language;
-views ->
-State#mrst.views;
-info ->
-#mrst{
-fd = Fd,
-sig = Sig,
-id_btree = IdBtree,
-log_btree = LogBtree,
-language = Lang,
-update_seq = UpdateSeq,
-purge_seq = PurgeSeq,
-views = Views,
-design_opts = Opts
-} = State,
-{ok, FileSize} = couch_file:bytes(Fd),
-{ok, ExternalSize} = 
couch_mrview_util:calculate_external_size(Views),
-LogBtSize = case LogBtree of
-nil ->
-0;
-_ ->
-couch_btree:size(LogBtree)
-end,
-ActiveSize = couch_btree:size(IdBtree) + LogBtSize + 
ExternalSize,
-
-IncDesign = couch_util:get_value(<<"include_design">>, Opts, 
false),
-LocalSeq = couch_util:get_value(<<"local_seq">>, Opts, false),
-SeqIndexed = couch_util:get_value(<<"seq_indexed">>, Opts, 
false),
-KeySeqIndexed = couch_util:get_value(<<"keyseq_indexed">>, 
Opts, false),
-UpdateOptions =
-if IncDesign -> [<<"include_design">>]; true -> [] end
-++ if LocalSeq -> [<<"local_seq">>]; true -> [] end
-++ if KeySeqIndexed -> [<<"keyseq_indexed">>]; true -> [] 
end
-++ if SeqIndexed -> [<<"seq_indexed">>]; true -> [] end,
-
-
-{ok, [
-{signature, list_to_binary(couch_index_util:hexsig(Sig))},
-{language, Lang},
-{disk_size, FileSize}, % legacy
-{data_size, ExternalSize}, % legacy
-{sizes, {[
-{file, FileSize},
-{active, ActiveSize},
-{external, ExternalSize}
-]}},
-{update_seq, UpdateSeq},
-{purge_seq, PurgeSeq},
-{update_options, UpdateOptions}
-]};
-Other ->
-throw({unknown_index_property, Other})
-end.
+get(db_name, #mrst{db_name = DbName}) ->
+DbName;
+get(idx_name, #mrst{idx_name = IdxName}) ->
+IdxName;
+get(signature, #mrst{sig = Signature}) ->
+Signature;
+get(update_seq, #mrst{update_seq = UpdateSeq}) ->
+UpdateSeq;
+get(purge_seq, #mrst{purge_seq = PurgeSeq}) ->
+PurgeSeq;
+get(update_options, #mrst{design_opts = Opts}) ->
+IncDesign = couch_util:get_value(<<"include_design">>, Opts, false),
+LocalSeq = couch_util:get_value(<<"local_seq">>, Opts, false),
+SeqIndexed = couch_util:get_value(<<"seq_indexed">>, Opts, false),
+KeySeqIndexed = couch_util:get_value(<<"keyseq_indexed">>, Opts, 
false),
+if 

[GitHub] couchdb-couch-replicator issue #54: Allow configuring maximum document ID le...

2017-02-06 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/54
  
The master has been updated. Rebasing. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #54: Allow configuring maximum document ID le...

2017-02-06 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/54
  
Nick is away today. However he asked me to help merging it. I am going to 
merge it on his behalf.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request #154: Add Error Clause For fabric:open_revs call...

2017-02-06 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-chttpd/pull/154#discussion_r99672964
  
--- Diff: test/chttpd_open_revs_error_test.erl ---
@@ -0,0 +1,107 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may 
not
+% use this file except in compliance with the License. You may obtain a 
copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations 
under
+% the License.
+
+-module(chttpd_open_revs_error_test).
+
+-include_lib("couch/include/couch_eunit.hrl").
+-include_lib("couch/include/couch_db.hrl").
+
+-define(USER, "chttpd_db_test_admin").
+-define(PASS, "pass").
+-define(AUTH, {basic_auth, {?USER, ?PASS}}).
+-define(CONTENT_JSON, {"Content-Type", "application/json"}).
+-define(CONTENT_MULTI_FORM, {"Content-Type",
+"multipart/form-data;boundary=\"bound\""}).
+
+setup() ->
+ok = config:set("admins", ?USER, ?PASS, _Persist=false),
+TmpDb = ?tempdb(),
+Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
+Port = mochiweb_socket_server:get(chttpd, port),
+Url = lists:concat(["http://";, Addr, ":", Port, "/", ?b2l(TmpDb)]),
+create_db(Url),
+Url.
+
+teardown(Url) ->
+delete_db(Url),
--- End diff --

Please add `(catch meck:unload(fabric)),` here. Alternatively you can 
revise the setup/teardown logic. Currently you do mocking from inside of a test 
case. You could use foreachx and pass `post_form | simple_put` parameter so you 
can do the right things in setup/1. In this case mocking would be in setup/1 
and unmocking in teardown/2.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request #154: Add Error Clause For fabric:open_revs call...

2017-02-06 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-chttpd/pull/154#discussion_r99671057
  
--- Diff: test/chttpd_open_revs_error_test.erl ---
@@ -0,0 +1,107 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may 
not
+% use this file except in compliance with the License. You may obtain a 
copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations 
under
+% the License.
+
+-module(chttpd_open_revs_error_test).
+
+-include_lib("couch/include/couch_eunit.hrl").
+-include_lib("couch/include/couch_db.hrl").
+
+-define(USER, "chttpd_db_test_admin").
+-define(PASS, "pass").
+-define(AUTH, {basic_auth, {?USER, ?PASS}}).
+-define(CONTENT_JSON, {"Content-Type", "application/json"}).
+-define(CONTENT_MULTI_FORM, {"Content-Type",
+"multipart/form-data;boundary=\"bound\""}).
+
+setup() ->
+ok = config:set("admins", ?USER, ?PASS, _Persist=false),
+TmpDb = ?tempdb(),
+Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
+Port = mochiweb_socket_server:get(chttpd, port),
+Url = lists:concat(["http://";, Addr, ":", Port, "/", ?b2l(TmpDb)]),
+create_db(Url),
+Url.
+
+teardown(Url) ->
+delete_db(Url),
+ok = config:delete("admins", ?USER, _Persist=false).
+
+create_db(Url) ->
+{ok, Status, _, _} = test_request:put(Url, [?CONTENT_JSON, ?AUTH], 
"{}"),
+?assert(Status =:= 201 orelse Status =:= 202).
+
+
+create_doc(Url, Id) ->
+test_request:put(Url ++ "/" ++ Id,
+[?CONTENT_JSON, ?AUTH], "{\"mr\": \"rockoartischocko\"}").
+
+delete_db(Url) ->
+{ok, 200, _, _} = test_request:delete(Url, [?AUTH]).
+
+open_revs_error_test_() ->
+{
+"open revs error tests",
+{
+setup,
+fun chttpd_test_util:start_couch/0, fun 
chttpd_test_util:stop_couch/1,
+{
+foreach,
+fun setup/0, fun teardown/1,
+[
+fun should_return_503_error_for_open_revs_get/1,
+fun should_return_503_error_for_open_revs_post_form/1
+]
+}
+}
+}.
+
+should_return_503_error_for_open_revs_get(Url) ->
+{ok, _, _, Body} = create_doc(Url, "testdoc"),
+{Json} = ?JSON_DECODE(Body),
+Ref = couch_util:get_value(<<"rev">>, Json, undefined),
+mock(fabric),
+mock_open_revs({error, all_workers_died}),
+ok, Code, _, _} = test_request:get(Url ++
+"/testdoc?rev=" ++ ?b2l(Ref), [?AUTH]),
+ meck:unload(fabric),
+ ?_assertEqual(503, Code).
+
+should_return_503_error_for_open_revs_post_form(Url) ->
+Port = mochiweb_socket_server:get(chttpd, port),
+Host = lists:concat([ "http://127.0.0.1:";, Port]),
+Referer = {"Referer", Host},
+Body1 = "{\"body\":\"This is a body.\"}",
+DocBeg = "--bound\r\nContent-Disposition: form-data; 
name=\"_doc\"\r\n\r\n",
+DocRev = "--bound\r\nContent-Disposition: form-data; 
name=\"_rev\"\r\n\r\n",
+DocRest = lists:concat(["\r\n--bound\r\nContent-Disposition:",
--- End diff --

You could write this as:
```
DocRest = "\r\n--bound\r\nContent-Disposition:"
"form-data; name=\"_attachments\"; filename=\"file.txt\"\r\n"
"Content-Type: text/plain\r\n\r\ncontents of file.txt\r\n\r\n"
"--bound--",
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-chttpd pull request #154: Add Error Clause For fabric:open_revs call...

2017-02-06 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-chttpd/pull/154#discussion_r99669106
  
--- Diff: test/chttpd_open_revs_error_test.erl ---
@@ -0,0 +1,107 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may 
not
+% use this file except in compliance with the License. You may obtain a 
copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations 
under
+% the License.
+
+-module(chttpd_open_revs_error_test).
+
+-include_lib("couch/include/couch_eunit.hrl").
+-include_lib("couch/include/couch_db.hrl").
+
+-define(USER, "chttpd_db_test_admin").
+-define(PASS, "pass").
+-define(AUTH, {basic_auth, {?USER, ?PASS}}).
+-define(CONTENT_JSON, {"Content-Type", "application/json"}).
+-define(CONTENT_MULTI_FORM, {"Content-Type",
+"multipart/form-data;boundary=\"bound\""}).
+
+setup() ->
+ok = config:set("admins", ?USER, ?PASS, _Persist=false),
+TmpDb = ?tempdb(),
+Addr = config:get("chttpd", "bind_address", "127.0.0.1"),
+Port = mochiweb_socket_server:get(chttpd, port),
+Url = lists:concat(["http://";, Addr, ":", Port, "/", ?b2l(TmpDb)]),
+create_db(Url),
+Url.
+
+teardown(Url) ->
+delete_db(Url),
+ok = config:delete("admins", ?USER, _Persist=false).
+
+create_db(Url) ->
+{ok, Status, _, _} = test_request:put(Url, [?CONTENT_JSON, ?AUTH], 
"{}"),
+?assert(Status =:= 201 orelse Status =:= 202).
+
+
+create_doc(Url, Id) ->
+test_request:put(Url ++ "/" ++ Id,
+[?CONTENT_JSON, ?AUTH], "{\"mr\": \"rockoartischocko\"}").
+
+delete_db(Url) ->
+{ok, 200, _, _} = test_request:delete(Url, [?AUTH]).
+
+open_revs_error_test_() ->
+{
+"open revs error tests",
+{
+setup,
+fun chttpd_test_util:start_couch/0, fun 
chttpd_test_util:stop_couch/1,
+{
+foreach,
+fun setup/0, fun teardown/1,
+[
+fun should_return_503_error_for_open_revs_get/1,
+fun should_return_503_error_for_open_revs_post_form/1
+]
+}
+}
+}.
+
+should_return_503_error_for_open_revs_get(Url) ->
+{ok, _, _, Body} = create_doc(Url, "testdoc"),
+{Json} = ?JSON_DECODE(Body),
+Ref = couch_util:get_value(<<"rev">>, Json, undefined),
+mock(fabric),
+mock_open_revs({error, all_workers_died}),
+ok, Code, _, _} = test_request:get(Url ++
--- End diff --

@tonysun83: There is a syntax error here (missing `{`)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #225: Remove dead code from couch_file

2017-02-01 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/225
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #52: Use mem3 to discover all _replicator sha...

2017-01-24 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/52
  
Tests pass locally. +1
```
Running test function(s):
  couch_replicator_manager:replicator_shards_test_/0
 EUnit 
couch_replicator_manager:1012: t_pass_replicator_shard...[0.219 s] ok
couch_replicator_manager:1022: t_fail_non_replicator_shard...[0.072 s] ok
===
  All 2 tests passed.
``` 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator pull request #52: Use mem3 to discover all _replica...

2017-01-24 Thread iilyak
Github user iilyak commented on a diff in the pull request:


https://github.com/apache/couchdb-couch-replicator/pull/52#discussion_r97556211
  
--- Diff: src/couch_replicator_manager.erl ---
@@ -931,24 +931,34 @@ strip_credentials({Props}) ->
 {lists:keydelete(<<"oauth">>, 1, Props)}.
 
 scan_all_dbs(Server) when is_pid(Server) ->
-Root = config:get("couchdb", "database_dir", "."),
-NormRoot = couch_util:normpath(Root),
-filelib:fold_files(Root, "_replicator(\\.[0-9]{10,})?.couch$", true,
-fun(Filename, Acc) ->
-   % shamelessly stolen from couch_server.erl
-NormFilename = couch_util:normpath(Filename),
-case NormFilename -- NormRoot of
-[$/ | RelativeFilename] -> ok;
-RelativeFilename -> ok
-end,
-DbName = ?l2b(filename:rootname(RelativeFilename, ".couch")),
-Jitter = jitter(Acc),
-spawn_link(fun() ->
-timer:sleep(Jitter),
-gen_server:cast(Server, {resume_scan, DbName})
-end),
-   Acc + 1
-   end, 1).
+{ok, Db} = mem3_util:ensure_exists(
+config:get("mem3", "shard_db", "dbs")),
+ChangesFun = couch_changes:handle_changes(#changes_args{}, nil, Db, 
nil),
+ChangesFun(fun({change, {Change}, _}, _) ->
+DbName = couch_util:get_value(<<"id">>, Change),
+case DbName of <<"_design/", _/binary>> -> ok; _Else ->
+case couch_replicator_utils:is_deleted(Change) of
+true ->
+ok;
+false ->
+[gen_server:cast(Server, {resume_scan, ShardName})
--- End diff --

I stopped here for a bit because original code calls resume_scan for the 
DbName and not ShardName. However we don't use fabric here and open shards 
directly. It looks good to me. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator pull request #52: Use mem3 to discover all _replica...

2017-01-24 Thread iilyak
Github user iilyak commented on a diff in the pull request:


https://github.com/apache/couchdb-couch-replicator/pull/52#discussion_r97555698
  
--- Diff: src/couch_replicator_manager.erl ---
@@ -980,3 +990,34 @@ get_json_value(Key, Props, Default) when 
is_binary(Key) ->
 Else ->
 Else
 end.
+
+
--- End diff --

The following is missing which leads to compilation error about undefined 
macro `?_test`
```
-ifdef(TEST).
-include_lib("couch/include/couch_eunit.hrl").
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #220: Fix couchdb_views tests

2017-01-06 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/220
  
Tests pass locally. +1
```
 EUnit 
module 'couchdb_views_tests'
  View indexes cleanup
couchdb_views_tests:214: 
should_have_two_indexes_alive_before_deletion...ok
couchdb_views_tests:219: 
should_cleanup_index_file_after_ddoc_deletion...ok
couchdb_views_tests:225: should_cleanup_all_index_files...ok
[done in 0.426 s]
  View group db leaks
couchdb_views_tests:228: couchdb_1138...[0.254 s] ok
couchdb_views_tests:266: couchdb_1309...[0.043 s] ok
[done in 0.404 s]
  View group shutdown
couchdb_views_tests:315: couchdb_1283...[0.187 s] ok
[done in 0.190 s]
  Upgrade and bugs related tests
couchdb_views_tests:159: 
should_not_remember_docs_in_index_after_backup_restore...[0.029 s] ok
[done in 0.097 s]
  Upgrade tests
couchdb_views_tests:181: should_upgrade_legacy_view_files...[2.055 s] ok
[done in 2.066 s]
  [done in 4.816 s]
===
  All 8 tests passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #220: Fix couchdb_views tests

2017-01-05 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/220
  
@eiri: I am concerned that in some case we change `2 -> 3` and in other `2 
-> 4`. I understand the reason for this though. However strictly speaking 
couch_file process is not a user of a db. Wouldn't it be better to change 
count_users function to account for additional monitors? Following works 
locally:
```
 count_users(DbName) ->
 {ok, Db} = couch_db:open_int(DbName, [?ADMIN_CTX]),
 {monitored_by, Monitors} = erlang:process_info(Db#db.main_pid, 
monitored_by),
+CouchFiles = [P || P <- Monitors, couch_file:process_info(P) =/= 
undefined],
 ok = couch_db:close(Db),
-length(lists:usort(Monitors) -- [self()]).
+length(lists:usort(Monitors) -- [self() | CouchFiles]).
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #218: Make revision generation deterministic

2016-12-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/218
  
+1. Tests pass locally. 

```
Compiled test/chttpd_endpoints_tests.erl
Running test function(s):
  couch_db_mpr_tests:couch_db_mpr_test_/0
 EUnit 
multi-part attachment tests
  couch_db_mpr_tests: couch_db_mpr_test_...[0.256 s] ok
  [done in 0.260 s]
===
  Test passed.
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #218: Make revision generation deterministic

2016-12-13 Thread iilyak
Github user iilyak commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/218#discussion_r92292861
  
--- Diff: src/couch_db.erl ---
@@ -860,14 +860,24 @@ prep_and_validate_replicated_updates(Db, 
[Bucket|RestBuckets], [OldInfo|RestOldI
 
 
 
-new_revid(#doc{body=Body, revs={OldStart,OldRevs}, atts=Atts, 
deleted=Deleted}) ->
+new_revid(#doc{body=Body0, revs={OldStart,OldRevs}, atts=Atts, 
deleted=Deleted}) ->
 DigestedAtts = lists:foldl(fun(Att, Acc) ->
 [N, T, M] = couch_att:fetch([name, type, md5], Att),
 case M == <<>> of
 true -> Acc;
 false -> [{N, T, M} | Acc]
 end
 end, [], Atts),
+Body = case Body0 of
+{summary, [_Len, _Md5, BodyAtts], _SizeInfo, _AttsFd} ->
+{CompBody, _CompAtts} = binary_to_term(BodyAtts),
+couch_compress:decompress(CompBody);
+{symmary, [_Len, BodyAtts], _SizeInfo, _AttsFd} ->
--- End diff --

it looks like a typo `symmary`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb issue #447: Bump dependencies

2016-12-12 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb/pull/447
  
+1. Great job. Finally we would have green status on travis. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview pull request #63: Convert pid of indexer to binary

2016-12-01 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-couch-mrview/pull/63

Convert pid of indexer to binary

This is a fixup for https://github.com/apache/couchdb-couch-mrview/pull/62
Properties passed to couch_task_status:add_task cannot contain complex
types. Because the status need to be representable in JSON.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch-mrview 
77867-convert-pid-to-binary

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch-mrview/pull/63.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #63


commit c49211cdca99a198235a6a8798692d8b1163f6bf
Author: ILYA Khlopotov 
Date:   2016-12-02T00:51:46Z

Convert pid of indexer to binary

This is a fixup for https://github.com/apache/couchdb-couch-mrview/pull/62
Properties passed to couch_task_status:add_task cannot contain complex
types. Because the status need to be representable in JSON.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb pull request #443: Bump dependencies

2016-11-30 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb/pull/443


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb pull request #443: Bump dependencies

2016-11-30 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb/pull/443

Bump dependencies

## List of updates 

fabric: 7cfabb..205064
 * Merge remote branch 'cloudant:77984-fixup' ([FB 
77984](https://cloudant.fogbugz.com/f/cases/77984))
 * Use upgraded #mrargs{} instead of old one
 * Merge remote branch 'cloudant:fix-typespecs'
 * Add `{error, Reason}` to typespecs
 * Merge remote branch 'cloudant:77984-upgrade-mrargs-record-phase2' ([FB 
77984](https://cloudant.fogbugz.com/f/cases/77984))
 * Revert "Revert "Merge remote-tracking branch 
'banjiewen/stale-stable-update'""
 * Upgrade #mrargs{} record
 * Merge remote branch 'cloudant:77984-upgrade-mrargs-record-phase1' ([FB 
77984](https://cloudant.fogbugz.com/f/cases/77984))
 * Compatibility clause for the record upgrade
 * Revert "Merge remote-tracking branch 'banjiewen/stale-stable-update'"
 * Merge remote-tracking branch 'cloudant/3232-all-docs-ctx' 
([COUCHDB-3232](https://issues.apache.org/jira/browse/COUCHDB-3232))
 * Merge branch 'COUCHDB-3234-open-shard-timeout-counter' 
([COUCHDB-3234-open-shard-timeout-counter'](https://issues.apache.org/jira/browse/COUCHDB-3234-open-shard-timeout-counter'))
 * Track open_shard timeouts with a counter 
([COUCHDB-3234](https://issues.apache.org/jira/browse/COUCHDB-3234))
 * Pass user_ctx down to fabric_rpc 
([COUCHDB-3232](https://issues.apache.org/jira/browse/COUCHDB-3232))

couch_epi: f6ad55..60e7f8
 * Merge remote branch 'DeadZen:patch-1'
 * Update README.md

mochiweb: bd6ae7..cb521b
 * Don't use message queue for request handling
 * Merge tag 'v2.12.0'
 * Revert "COUCHDB-627 - Support all timezones" ([COUCHDB-627 - Support all 
timezones"](https://issues.apache.org/jira/browse/COUCHDB-627 - Support all 
timezones"))
 * Revert "Fix Mochiweb acceptor blocked in ssl handshake"
 * Revert "Don't use message queue for request handling"
 * remove binary rebar
 * Don't use message queue for request handling
 * Fix Mochiweb acceptor blocked in ssl handshake
 * COUCHDB-627 - Support all timezones ([COUCHDB-627 - Support all 
timezones](https://issues.apache.org/jira/browse/COUCHDB-627 - Support all 
timezones))

docs: 52a287..2993cc
 * Spelling error fix: fauxuton to fauxton

chttpd: 3dcdb6..d6282b
 * Merge remote branch 'cloudant:71810-handle-errors-terms-from-fabric' 
([FB 71810](https://cloudant.fogbugz.com/f/cases/71810))
 * Handle error terms from fabric 
([COUCHDB-3195](https://issues.apache.org/jira/browse/COUCHDB-3195))
 * Merge remote branch 'cloudant:78077-pass-user_ctx_to_filter' ([FB 
78077](https://cloudant.fogbugz.com/f/cases/78077))
 * Include user_ctx in db open options

couch: b4cd67..54890e
 * Handle open_result message that arrives after the delete 
([COUCHDB-3241](https://issues.apache.org/jira/browse/COUCHDB-3241))
 * Merge remote branch 'cloudant:71810-handle-errors-terms-from-fabric' 
([FB 71810](https://cloudant.fogbugz.com/f/cases/71810))
 * Add test suite for handling errors from fabric 
([COUCHDB-3195](https://issues.apache.org/jira/browse/COUCHDB-3195))
 * Merge remote branch 
'cloudant:78142-allow-user-to-correct-invalid-user-docs' ([FB 
78142](https://cloudant.fogbugz.com/f/cases/78142))
 * Allow fixing users' documents 
([COUCHDB-3231](https://issues.apache.org/jira/browse/COUCHDB-3231))
 * Merge remote branch 'cloudant:75431-truncate-revs-to-revs_limit' ([FB 
75431](https://cloudant.fogbugz.com/f/cases/75431))
 * Truncate revs returned from couch_db:open_doc_revs 
([COUCHDB-3193](https://issues.apache.org/jira/browse/COUCHDB-3193))

mango: ddd6a4..30b369
 * remove docs for missing_is_null as the feature was removed

mem3: 252467..c3c542
 * Merge remote branch 'cloudant:79066-port-chunkified-replicate_batch' 
([FB 79066](https://cloudant.fogbugz.com/f/cases/79066))
 * Chunk missing revisions before attempting to save on target ([FB 
37676](https://cloudant.fogbugz.com/f/cases/37676))

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb bump-deps

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb/pull/443.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #443


commit d614f9f6dd389abeba98a05d9d481e06beb201c4
Author: ILYA Khlopotov 
Date:   2016-11-30T15:51:38Z

Bump dependencies




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request #76: 77984 upgrade mrargs record4

2016-11-30 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-fabric/pull/76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #76: 77984 upgrade mrargs record4

2016-11-30 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/76
  
Closing it in favor of already merged:
- https://github.com/apache/couchdb-fabric/issues/78
- https://github.com/apache/couchdb-fabric/issues/77
- https://github.com/apache/couchdb-fabric/pull/80


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #215: Implement couch_file:format_status to log f...

2016-11-28 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-couch/pull/215

Implement couch_file:format_status to log filepath

Erlang OTP logs the fact when gen_server behavior crashes. However in case 
of `couch_file` the filename is not part of the state. So it is quite hard to 
figure out what happened given the current log entry format. This PR adds 
information about filepath to the log entry. Keep in mind though that the 
filepath value is captured on couch_file:start_link. It is not representing the 
current file name if file is renamed or moved. 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch log_file_path_on_crash

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch/pull/215.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #215


commit b4c050d1d9661fccdf2ddbe0cbc92f9c77e606ae
Author: ILYA Khlopotov 
Date:   2016-11-28T17:50:47Z

Implement couch_file:format_status to log filepath




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #51: Format gen_server state to remove plain ...

2016-11-28 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/51
  
@tonysun83: I did check all places where we call `gen_server:call/cast`. We 
never send credentials in the message. So they shouldn't leak in LastMsg. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview pull request #62: Add reference to indexer Pid to task ...

2016-11-18 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-couch-mrview/pull/62

Add reference to indexer Pid to task status

When we run re-compaction stage we start second index updater from view 
compactor. In this case couch_task_status:all would return two identical 
entries for the same `design_document` and `shard`. Which is very confusing. 
Add reference to indexer Pid to disambiguate them.
For the recompaction case the indexer_pid will be pointing to compaction 
task.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch-mrview 
77867-add-indexer-pid-to-task-status

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch-mrview/pull/62.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #62


commit b3b1b121f6a153f0e3febc95cfbace597e4a9aab
Author: ILYA Khlopotov 
Date:   2016-11-18T22:19:11Z

Add reference to indexer Pid to task status

When we run re-compaction stage we start second index updater from
view compactor. In this case couch_task_status:all would return two
identical entries for the same `design_document` and `shard`. Which is
very confusing. Add reference to indexer Pid to disambiguate them.
For the recompaction case the indexer_pid will be pointing to compaction 
task.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request #80: Use upgraded #mrargs{} instead of old one

2016-11-17 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-fabric/pull/80

Use upgraded #mrargs{} instead of old one

Fixup for a previously merged commit 
bed5c67f9633d2837aa51c1aeb078fc671fa1e27

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-fabric 77984-fixup

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-fabric/pull/80.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #80


commit 863b8d9671d57c3125b954a3f63467a1c7c5f01f
Author: ILYA Khlopotov 
Date:   2016-11-17T17:44:31Z

Use upgraded #mrargs{} instead of old one




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #51: Format gen_server state to remove plain ...

2016-11-17 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/51
  
I think I know what you mean.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request #79: Add `{error, Reason}` to typespecs

2016-11-16 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-fabric/pull/79

Add `{error, Reason}` to typespecs

`fabric:design_docs/1` and `all_docs/5` can return `{error, Reason}`

see 
[here](https://github.com/apache/couchdb-fabric/blob/master/src/fabric_view_all_docs.erl#L46)
 and 
[here](https://github.com/apache/couchdb-fabric/blob/master/src/fabric.erl#L427)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-fabric fix-typespecs

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-fabric/pull/79.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #79


commit 5e7e170525c9cfc7430e8cc81ace949e67d2da47
Author: ILYA Khlopotov 
Date:   2016-11-16T21:57:29Z

Add `{error, Reason}` to typespecs

`fabric:design_docs/1` and `all_docs/5` can return `{error, Reason}`




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-replicator issue #51: Format gen_server state to remove plain ...

2016-11-16 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-replicator/pull/51
  
@tonysun83: Could you elaborate what you mean  `we still leak passwords in 
LastMsg`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #78: 77984 upgrade mrargs record phase2

2016-11-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/78
  
I'll use a +1 from PR #76.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #76: 77984 upgrade mrargs record4

2016-11-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/76
  
Second phase PR https://github.com/apache/couchdb-fabric/pull/78


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request #78: 77984 upgrade mrargs record phase2

2016-11-14 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-fabric/pull/78

77984 upgrade mrargs record phase2

Second phase for #mrargs{} record upgrade.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-fabric 
77984-upgrade-mrargs-record-phase2

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-fabric/pull/78.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #78


commit f14cd78590e650ae070e2f40dde101c1dde8ed83
Author: ILYA Khlopotov 
Date:   2016-11-14T21:17:09Z

Upgrade #mrargs{} record

commit 4377acf2d1bcbe7fd0078417f038d1da93d86fd2
Author: ILYA Khlopotov 
Date:   2016-11-14T21:17:12Z

Revert "Revert "Merge remote-tracking branch 
'banjiewen/stale-stable-update'""

This reverts commit a8e0e9549bb2a1181538ae433f1de78abadc41d5.

Note: Re-aplying previously reverted merge




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #76: 77984 upgrade mrargs record4

2016-11-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/76
  
This is the first phase PR https://github.com/apache/couchdb-fabric/pull/77


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric issue #77: upgrade mrargs record phase 1

2016-11-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-fabric/pull/77
  
I'll use a `+1` from PR https://github.com/apache/couchdb-fabric/pull/76.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-fabric pull request #77: upgrade mrargs record phase 1

2016-11-14 Thread iilyak
GitHub user iilyak opened a pull request:

https://github.com/apache/couchdb-fabric/pull/77

upgrade mrargs record phase 1

First phase for #mrargs{} record upgrade.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-fabric 
77984-upgrade-mrargs-record-phase1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-fabric/pull/77.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #77


commit a8e0e9549bb2a1181538ae433f1de78abadc41d5
Author: ILYA Khlopotov 
Date:   2016-11-14T21:10:39Z

Revert "Merge remote-tracking branch 'banjiewen/stale-stable-update'"

This reverts commit 508122c52731a9eac3e83f8d727f2355f019fe1f, reversing
changes made to d68a00fdeba9113bd1a3dd41d8e546b05bb2e533.

commit bed5c67f9633d2837aa51c1aeb078fc671fa1e27
Author: ILYA Khlopotov 
Date:   2016-11-14T21:13:11Z

Compatibility clause for the record upgrade




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #212: Support functions to introduce versioned re...

2016-11-14 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/212


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview pull request #60: Upgrade/downgrade mrargs record

2016-11-14 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch-mrview/pull/60


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch issue #212: Support functions to introduce versioned records

2016-11-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch/pull/212
  
Closing in favor of a different approach apache/couchdb-fabric#76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview issue #60: Upgrade/downgrade mrargs record

2016-11-14 Thread iilyak
Github user iilyak commented on the issue:

https://github.com/apache/couchdb-couch-mrview/pull/60
  
Closing in favor of a different approach 
https://github.com/apache/couchdb-fabric/pull/76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   3   4   5   6   7   >