couchdb-couch.git
5 years agoEnsure multi-item chunks in couch_btree:chunkify/1 COUCHDB-3298-improve-couch-btree-chunkify 228/head
Paul J. Davis [Sat, 11 Feb 2017 21:29:14 +0000 (15:29 -0600)] 
Ensure multi-item chunks in couch_btree:chunkify/1

If the last element of a chunk has a huge reduction it was possible to
return a btree node that had a single key. This prevents the edge case
by forcing it into the previous chunk. Without this we can end up with a
case where a path in the tree can extend for many levels with only a
single key in each node.

COUCHDB-3298

5 years agoMake couch_btree:chunkify/1 prefer fewer chunks
Paul J. Davis [Sat, 11 Feb 2017 21:26:26 +0000 (15:26 -0600)] 
Make couch_btree:chunkify/1 prefer fewer chunks

This changes couch_btree:chunkify/1 to produce fewer larger chunks
rather than creating chunks of even-ish size.

COUCHDB-3298

5 years agoMerge branch 'couchdb-3284-remove-dead-code'
Nick Vatamaniuc [Wed, 1 Feb 2017 19:48:07 +0000 (14:48 -0500)] 
Merge branch 'couchdb-3284-remove-dead-code'

Closes #225

5 years agoRemove dead code from couch_file 225/head
Nick Vatamaniuc [Wed, 1 Feb 2017 19:42:59 +0000 (14:42 -0500)] 
Remove dead code from couch_file

This code was left over after removing 8kB read-ahead

https://github.com/apache/couchdb-couch/pull/223/commits/d52a5335d930d11ade4953c8576d22f55872ff6f

COUCHDB-3284

5 years agoMerge branch 'couchdb-3284'
Nick Vatamaniuc [Tue, 31 Jan 2017 15:52:47 +0000 (10:52 -0500)] 
Merge branch 'couchdb-3284'

closes #223

5 years agoMerge remote branch 'cloudant:82197-fix-validation_func-case_clause'
Eric Avdey [Tue, 31 Jan 2017 13:27:28 +0000 (09:27 -0400)] 
Merge remote branch 'cloudant:82197-fix-validation_func-case_clause'

This closes #224

Signed-off-by: Eric Avdey <eiri@eiri.ca>
5 years agoDon't crash on unexpected validation's error type 224/head
Eric Avdey [Mon, 30 Jan 2017 19:27:59 +0000 (15:27 -0400)] 
Don't crash on unexpected validation's error type

Validation function can throw JSON with error
type different than forbidden or unauthorized.

This patch makes couch return unknown_error
instead of crashing query server.

COUCHDB-3286

5 years agoRemove 8kB read-ahead from couch_file 223/head
Nick Vatamaniuc [Fri, 27 Jan 2017 17:04:01 +0000 (12:04 -0500)] 
Remove 8kB read-ahead from couch_file

In production it showed an increased input Erlang IO and increased binary
memory usage.

See attached file in Jira ticket:

COUCHDB-3284

5 years agoReset EOF if a partial write was possible 222/head
Robert Newson [Thu, 19 Jan 2017 23:12:00 +0000 (23:12 +0000)] 
Reset EOF if a partial write was possible

We can't know if one or more bytes were written by a file:write/2 call
that results in an error and so it is not correct to leave #file.eof
at its original value. In the event of error, use file:position(Fd,
eof) to find the new, true length of the file, and update #file{}
accordingly.

COUCHDB-3274

5 years agoMerge remote branch 'cloudant:validate-count-in-uuids'
Eric Avdey [Wed, 18 Jan 2017 15:34:00 +0000 (11:34 -0400)] 
Merge remote branch 'cloudant:validate-count-in-uuids'

This closes #221

Signed-off-by: Eric Avdey <eiri@eiri.ca>
5 years agoReturn "Bad Request" when count in /_uuids exceeds max 221/head
Eric Avdey [Wed, 18 Jan 2017 13:55:19 +0000 (09:55 -0400)] 
Return "Bad Request" when count in /_uuids exceeds max

5 years agoValidate that count in /_uuids is positive
Eric Avdey [Wed, 18 Jan 2017 13:44:15 +0000 (09:44 -0400)] 
Validate that count in /_uuids is positive

5 years agoMerge remote branch 'cloudant:fix-views_tests'
Eric Avdey [Fri, 6 Jan 2017 14:06:44 +0000 (10:06 -0400)] 
Merge remote branch 'cloudant:fix-views_tests'

This closes #220

Signed-off-by: Eric Avdey <eiri@eiri.ca>
5 years agoFix couchdb_views tests 220/head
Eric Avdey [Thu, 5 Jan 2017 21:30:00 +0000 (17:30 -0400)] 
Fix couchdb_views tests

Previous commit made couch_file to monitor db_pid
instead of linking ot it, so number of monitored_by
for couch_db process, checked in couchdb_views_tests,
changed.

COUCHDB-3259

5 years agoDon't trap exits in couch_file 219/head
Robert Newson [Tue, 20 Dec 2016 22:32:44 +0000 (22:32 +0000)] 
Don't trap exits in couch_file

It turns out to be impossible to trap the exit message from the parent
process in a gen_server, which is the only reason couch_file traps
exits in the first place (i.e, this has never worked).

This commit also changes the hot upgrade code to handle this
transition (but not the previous one).

COUCHDB-3259

5 years agoMerge branch 'COUCHDB-3255-fix-new-revid'
Paul J. Davis [Thu, 15 Dec 2016 15:47:27 +0000 (09:47 -0600)] 
Merge branch 'COUCHDB-3255-fix-new-revid'

5 years agoMake revision generation deterministic 218/head
Paul J. Davis [Tue, 13 Dec 2016 23:30:46 +0000 (17:30 -0600)] 
Make revision generation deterministic

This removes the influence of the attachment disk information when
generating revisions when a document is being recreated (ie, it existed
once but has been deleted).

Big thanks to @tonysun83 for getting a reproducer as well as the test
included with this PR.

COUCHDB-3255

5 years agoMerge remote branch 'cloudant:add-filter-changes-test'
Eric Avdey [Tue, 13 Dec 2016 14:07:48 +0000 (10:07 -0400)] 
Merge remote branch 'cloudant:add-filter-changes-test'

This closes #213

Signed-off-by: Eric Avdey <eiri@eiri.ca>
5 years agoAdd tests for filter by filter function 213/head
Eric Avdey [Sat, 12 Nov 2016 00:50:37 +0000 (20:50 -0400)] 
Add tests for filter by filter function

5 years agoReduce duplicated code, rename vars consistently
Eric Avdey [Sat, 12 Nov 2016 00:38:50 +0000 (20:38 -0400)] 
Reduce duplicated code, rename vars consistently

5 years agoPrevent consumer from hiding error messages
Eric Avdey [Fri, 11 Nov 2016 22:53:23 +0000 (18:53 -0400)] 
Prevent consumer from hiding error messages

5 years agoMerge branch '3251-remove-filename-rootname'
Paul J. Davis [Wed, 7 Dec 2016 17:10:36 +0000 (11:10 -0600)] 
Merge branch '3251-remove-filename-rootname'

5 years agoRemove use of filename:rootname/1 217/head
Paul J. Davis [Tue, 6 Dec 2016 19:37:45 +0000 (13:37 -0600)] 
Remove use of filename:rootname/1

It turns out that filename:rootname/1 is fairly expensive. Given that we
call it millions of times when doing database name validation it adds up
significantly. This is a fairly easy optimization to just use binary
matching instead.

COUCHDB-3251

5 years agoMake couchjs -S option take effect 216/head
Nick Vatamaniuc [Wed, 30 Nov 2016 17:26:56 +0000 (12:26 -0500)] 
Make couchjs -S option take effect

Previously it was used to set JS context's stack chunk size.

Instead, to be effective it should set max GC size of the runtime.

Stack chunk size was set to the recommended value: 8K

This brings back an accidentally reverted commit:

https://github.com/apache/couchdb-couch/commit/62dafe81e13d7f8e27e95057e65f76d534aa2313

by @tilgovi

Reference:

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_NewContext

COUCHDB-3245

5 years agoHandle open_result message that arrives after the delete 214/head
Robert Newson [Wed, 23 Nov 2016 15:20:11 +0000 (15:20 +0000)] 
Handle open_result message that arrives after the delete

Opening a database is asynchronous, therefore it's possible for the
database to have been deleted before the open is complete. The
open_result code assumes this doesn't happen, so when it does,
couch_server crashes, taking the couch_dbs ETS table with it.

Explicitly handle the case and keep on keeping on.

COUCHDB-3241

5 years agoMerge remote branch 'cloudant:71810-handle-errors-terms-from-fabric'
ILYA Khlopotov [Sat, 12 Nov 2016 00:22:24 +0000 (16:22 -0800)] 
Merge remote branch 'cloudant:71810-handle-errors-terms-from-fabric'

This closes #206

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoAdd test suite for handling errors from fabric 206/head
ILYA Khlopotov [Thu, 13 Oct 2016 21:56:19 +0000 (14:56 -0700)] 
Add test suite for handling errors from fabric

COUCHDB-3195

5 years agoMerge remote branch 'cloudant:78142-allow-user-to-correct-invalid-user-docs'
ILYA Khlopotov [Fri, 11 Nov 2016 14:34:25 +0000 (06:34 -0800)] 
Merge remote branch 'cloudant:78142-allow-user-to-correct-invalid-user-docs'

This closes #211

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoAllow fixing users' documents 211/head
ILYA Khlopotov [Thu, 10 Nov 2016 23:02:51 +0000 (15:02 -0800)] 
Allow fixing users' documents

Allow adding missing fields:
- type
- roles

Allow update of the type field from incorrect value to the correct one
(currently it suppose to have value 'user').

COUCHDB-3231

5 years agoMerge remote branch 'cloudant:75431-truncate-revs-to-revs_limit'
ILYA Khlopotov [Thu, 10 Nov 2016 17:51:47 +0000 (09:51 -0800)] 
Merge remote branch 'cloudant:75431-truncate-revs-to-revs_limit'

This closes #205

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoTruncate revs returned from couch_db:open_doc_revs 205/head
ILYA Khlopotov [Thu, 13 Oct 2016 17:27:25 +0000 (10:27 -0700)] 
Truncate revs returned from couch_db:open_doc_revs

Return max revs_limit revisions from couch_db:open_doc_revs.

COUCHDB-3193

5 years agoAdd optional `fields` to change feed selectors 177/head
Nick Vatamaniuc [Thu, 2 Jun 2016 21:04:17 +0000 (17:04 -0400)] 
Add optional `fields` to change feed selectors

When using selectors with `include_docs=true` can specify an optional fields
array in the POST request JSON body.

Each element in the array can be a json field (or even a key path
specified as field1.field2...). Resulting documents will contain only the
specified document fields.

For example:
`
http://.../d1/_changes?filter=_selector&include_docs=true

{
  "selector": {"z" : {"$gte" : 1} }, "fields": ["field1", "field2"]

}
`
Will first select only document with "z" value >= 1, then will return only field1 and field2 in documents.

{ "field1": "field1value", "field2": "field2value"}

(This requires a companion pr in fabric to work)

Jira: COUCHDB-2988

5 years agoMerge remote branch 'cloudant:log_filepath_on_errors'
ILYA Khlopotov [Mon, 7 Nov 2016 18:15:02 +0000 (10:15 -0800)] 
Merge remote branch 'cloudant:log_filepath_on_errors'

This closes #210

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoInclude file_path on errors from couch_file 210/head
ILYA Khlopotov [Thu, 3 Nov 2016 16:05:00 +0000 (09:05 -0700)] 
Include file_path on errors from couch_file

Add PathFile as part of a reason for following errors:
 - read_beyond_eof
 - exceed_pread_limit exceptions

5 years agoMerge remote branch 'cloudant:add-couch_debug-opened_files_by_regexp'
ILYA Khlopotov [Fri, 21 Oct 2016 19:09:04 +0000 (12:09 -0700)] 
Merge remote branch 'cloudant:add-couch_debug-opened_files_by_regexp'

This closes #207

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoAdd couch_debug:opened_files_contains/1 207/head
ILYA Khlopotov [Fri, 21 Oct 2016 18:51:05 +0000 (11:51 -0700)] 
Add couch_debug:opened_files_contains/1

couch_debug:opened_files_contains is an efficient way to find out list
of file descriptors or couch_file processes which path contains given
substring.

5 years agoAdd couch_debug:opened_files_by_regexp/1
ILYA Khlopotov [Fri, 21 Oct 2016 18:26:18 +0000 (11:26 -0700)] 
Add couch_debug:opened_files_by_regexp/1

couch_debug:opened_files_by_regexp is an efficient way to find out list
of file descriptors or couch_file processes which path matches given
regexp

5 years agowhitespace change to trigger github mirror sync
Robert Newson [Wed, 12 Oct 2016 20:54:00 +0000 (21:54 +0100)] 
whitespace change to trigger github mirror sync

5 years agoFix module name in couch_httpd:check_max_request_length/1 call 204/head
Nick Vatamaniuc [Mon, 10 Oct 2016 05:47:49 +0000 (01:47 -0400)] 
Fix module name in couch_httpd:check_max_request_length/1 call

5 years agoMerge branch 'couchdb-3174'
Nick Vatamaniuc [Thu, 6 Oct 2016 21:14:52 +0000 (17:14 -0400)] 
Merge branch 'couchdb-3174'

5 years agoMerge remote-tracking branch 'banjiewen/stale-stable-update'
Robert Newson [Thu, 6 Oct 2016 18:01:50 +0000 (19:01 +0100)] 
Merge remote-tracking branch 'banjiewen/stale-stable-update'

5 years agoMerge remote branch 'cloudant:fix-find_newest_header-type-spec'
ILYA Khlopotov [Wed, 5 Oct 2016 21:28:51 +0000 (14:28 -0700)] 
Merge remote branch 'cloudant:fix-find_newest_header-type-spec'

This closes #203

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoupdate typespec of find_newest_header 203/head
ILYA Khlopotov [Wed, 5 Oct 2016 21:25:19 +0000 (14:25 -0700)] 
update typespec of find_newest_header

5 years agoMerge remote branch 'cloudant:69425-handle-truncated-req-in-recv_body'
ILYA Khlopotov [Wed, 5 Oct 2016 17:01:26 +0000 (10:01 -0700)] 
Merge remote branch 'cloudant:69425-handle-truncated-req-in-recv_body'

This closes #200

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoAdding test suite for trancated _update 200/head
ILYA Khlopotov [Thu, 22 Sep 2016 23:11:02 +0000 (16:11 -0700)] 
Adding test suite for trancated _update

COUCHDB-3158

5 years agoMerge remote-tracking branch 'cloudant/3061-adaptive-header-search'
Paul J. Davis [Tue, 4 Oct 2016 18:18:35 +0000 (13:18 -0500)] 
Merge remote-tracking branch 'cloudant/3061-adaptive-header-search'

5 years agoUse vectored reads to search for buried headers 185/head
Jay Doane [Tue, 4 Oct 2016 17:58:51 +0000 (10:58 -0700)] 
Use vectored reads to search for buried headers

Current behavior attempts to read a header at each block, starting at
the eof and working backwards one block at a time. Deeply buried headers
can take a long time to find, depending on the depth of the header,
server load, etc.

This commit changes the behavior so that if the last block in the file
does not contain a header, it switches to using a "vectored" approach
where multiple candidate header prefixes (of 5 bytes) are read in a
single operation, greatly speeding up the search. On a modern linux
system with SSD, we see improvements up to 15x.

COUCHDB-3061

5 years agoMerge branch '3173-fix-couchjs-character-replacement'
Paul J. Davis [Tue, 4 Oct 2016 14:51:43 +0000 (09:51 -0500)] 
Merge branch '3173-fix-couchjs-character-replacement'

5 years agoFix CouchJS character replacement 202/head
Paul J. Davis [Tue, 4 Oct 2016 14:45:36 +0000 (09:45 -0500)] 
Fix CouchJS character replacement

This was a bad backport from an old bug. We accidentally backed up when
looking at the second half of a surrogate pair. Instead the backup
should only happen when we see a low half of a surrogate pair with no
preceding high half.

COUCHDB-3173

5 years agoAdd max_document_size checking for multipart PUT requests 201/head
Nick Vatamaniuc [Tue, 4 Oct 2016 06:50:07 +0000 (02:50 -0400)] 
Add max_document_size checking for multipart PUT requests

Previously multipart/related PUT requests didn't check maximum request sizes.

This commit checks content-length and compares that with the maximum.

This means keeping the current "semantics" of max_document_size which actually
means "max request size". But this makes the check more efficient and can
be done earlier in request processing time.

Jira: COUCHDB-3174

5 years agoMerge remote branch 'cloudant:74046-authentication_db-should-be-sysdb' test-branch 259/head
ILYA Khlopotov [Tue, 20 Sep 2016 19:51:07 +0000 (12:51 -0700)] 
Merge remote branch 'cloudant:74046-authentication_db-should-be-sysdb'

This closes #198

Signed-off-by: ILYA Khlopotov <iilyak@apache.org>
5 years agoMake sure clustered authentication_db is sys_db 198/head
ILYA Khlopotov [Tue, 13 Sep 2016 18:42:47 +0000 (11:42 -0700)] 
Make sure clustered authentication_db is sys_db

Fixes the case when the following are configured to something other than _users
 - chttpd_auth.authentication_db
 - couch_httpd_auth.authentication_db

Introduce "couchdb.users_db_suffix" config key

Remove distinction between clustered and local users databases
configuration. We remove following configuration options and replace
them with "couchdb.users_db_suffix":

- chttpd_auth.authentication_db
- couch_httpd_auth.authentication_db

COUCHDB-2731

5 years agoMerge remote branch 'cloudant:define_couch_version'
ILYA Khlopotov [Tue, 20 Sep 2016 17:03:36 +0000 (10:03 -0700)] 
Merge remote branch 'cloudant:define_couch_version'

This closes #199

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
5 years agoDefine COUCHDB_VERSION macro 199/head
ILYA Khlopotov [Fri, 16 Sep 2016 20:13:08 +0000 (13:13 -0700)] 
Define COUCHDB_VERSION macro

5 years agoRemove rebar.config
ILYA Khlopotov [Fri, 16 Sep 2016 20:11:56 +0000 (13:11 -0700)] 
Remove rebar.config

5 years agoRevert "Get couch version from environment not git"
ILYA Khlopotov [Fri, 16 Sep 2016 20:38:53 +0000 (13:38 -0700)] 
Revert "Get couch version from environment not git"

This reverts commit c613dabf635ca3a5d6de2240d00b80c334dc8f43.

5 years agoRevert "get version from environment in cross-platform way"
ILYA Khlopotov [Fri, 16 Sep 2016 20:38:40 +0000 (13:38 -0700)] 
Revert "get version from environment in cross-platform way"

This reverts commit 7d0cfb5f9d1f0fcdc607b46f31ae33cbf65115df.

5 years agoPartial revert Fix Windows version string determ.."
ILYA Khlopotov [Fri, 16 Sep 2016 20:36:34 +0000 (13:36 -0700)] 
Partial revert Fix Windows version string determ.."

This partially reverts commit 70b61f08618c34f4604bebc2ad2b8d71f90cca5e.

5 years agoMerge branch 'fix-windows-version' of https://github.com/wohali/couchdb-couch
Joan Touzet [Mon, 12 Sep 2016 19:52:51 +0000 (15:52 -0400)] 
Merge branch 'fix-windows-version' of https://github.com/wohali/couchdb-couch

5 years agoFix Windows version string determination 197/head
Joan Touzet [Mon, 12 Sep 2016 19:28:31 +0000 (15:28 -0400)] 
Fix Windows version string determination

For some reason, the COUCHD_VERSION string on Windows is getting
suffixed whitespace. We fix this by string:strip(Version0, right) on the
variable before use.

5 years agoget version from environment in cross-platform way
Robert Newson [Mon, 12 Sep 2016 09:28:51 +0000 (10:28 +0100)] 
get version from environment in cross-platform way

5 years agoGet couch version from environment not git
Robert Newson [Sun, 11 Sep 2016 11:47:51 +0000 (12:47 +0100)] 
Get couch version from environment not git

5 years agoMerge branch '3140-disable-queue-as-fifo-test' of https://github.com/wohali/couchdb...
Joan Touzet [Sun, 11 Sep 2016 08:54:27 +0000 (04:54 -0400)] 
Merge branch '3140-disable-queue-as-fifo-test' of https://github.com/wohali/couchdb-couch

5 years agoDisable should_process_waiting_queue_as_fifo test 196/head
Joan Touzet [Sun, 11 Sep 2016 06:24:40 +0000 (02:24 -0400)] 
Disable should_process_waiting_queue_as_fifo test

COUCHDB-3140

This PR disables the problematic queue-as-fifo test. As written, any
call in a test to spawn_client/1 returns immediately, and does not
guarantee that the call to couch_query_servers:get_ddoc_process/2
returns before control flow proceeds to the next line in the eunit test.
As it turns out, on Windows, the call to spawn_client for ddoc5 succeeds
prior to the ddoc4 call in this test, thus always failing.

Insertion of a timer:sleep/1 call between the spawn_client/1 calls seems
to solve the problem, but even this is "lucky" behaviour. Semantically
the way this test is written, with spawn_client/1 using spawn/1 to spin
off the actual get_ddoc_process/2 call, there is no guarantee that the
couch_proc_manager FIFO queue is being populated correctly.

Further, if the get_ddoc_process/2 call takes longer than the defined
timeout (5000 ms) this test will always fail, as no provision is made to
keep trying for an os_process after that time. Again we are "lucky" that
the test runs fast enough that this is not a problem, but relying on a
performant BEAM VM for test success in any regard is equally
problematic.

For this reason I am completely commenting out this test until the
harness can be fixed. I believe the impact to couchdb is minimal.

(It also suggests we may want to rethink how requests for os processes
are queued and issued at some point in the future; this approach seems
sub-optimal, especially if strict FIFO ordering is an expectation of the
system.)

/cc @eiri @rnewson @janl

5 years agoFix unused variables warning
Robert Newson [Sat, 10 Sep 2016 09:03:54 +0000 (10:03 +0100)] 
Fix unused variables warning

UserCtx was available here in the past so we could upgrade password
hashes when authenticating. In the clustered case we found this to be
messy as multiple attempts to upgrade the same document would occur
close together. For 2.0, we elected to remove this upgrade-on-auth
path.

5 years agooption to disable runtime code evaluation
Randall Leeds [Sun, 24 Apr 2016 00:49:34 +0000 (17:49 -0700)] 
option to disable runtime code evaluation

5 years agoMerge remote branch 'cloudant:3114-fix-docid-validation'
Eric Avdey [Thu, 1 Sep 2016 14:10:27 +0000 (11:10 -0300)] 
Merge remote branch 'cloudant:3114-fix-docid-validation'

This closes #193

Signed-off-by: Eric Avdey <eiri@eiri.ca>
5 years agoFix validation for ddoc name 193/head
Eric Avdey [Thu, 1 Sep 2016 12:51:14 +0000 (09:51 -0300)] 
Fix validation for ddoc name

5 years agofeat: allow couchspawnkillable to live in directories with spaces
Jan Lehnardt [Wed, 31 Aug 2016 19:39:13 +0000 (21:39 +0200)] 
feat: allow couchspawnkillable to live in directories with spaces

5 years agoMerge remote branch 'cloudant:3102-fix-config_subscription'
ILYA Khlopotov [Tue, 23 Aug 2016 21:59:27 +0000 (14:59 -0700)] 
Merge remote branch 'cloudant:3102-fix-config_subscription'

This closes #192

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
5 years agoUse `define` to avoid repeating yourself 192/head
ILYA Khlopotov [Tue, 23 Aug 2016 20:15:57 +0000 (13:15 -0700)] 
Use `define` to avoid repeating yourself

COUCHDB-3102

5 years agoUpdate handle_config_terminate API
ILYA Khlopotov [Wed, 17 Aug 2016 18:24:08 +0000 (11:24 -0700)] 
Update handle_config_terminate API

COUCHDB-3102

5 years agoMerge remote branch 'cloudant:66640-simplify-proc_manager'
Eric Avdey [Tue, 16 Aug 2016 15:08:56 +0000 (12:08 -0300)] 
Merge remote branch 'cloudant:66640-simplify-proc_manager'

This closes #191

Signed-off-by: Eric Avdey <eiri@eiri.ca>
5 years agoAdd tests for process pool 191/head
Eric Avdey [Mon, 15 Aug 2016 16:45:20 +0000 (13:45 -0300)] 
Add tests for process pool

This adds tests for re-use of procs,
proper waiters dequeue and idle pool reduction

5 years agoSimplify proc manager assignment logic
Eric Avdey [Thu, 11 Aug 2016 20:45:32 +0000 (17:45 -0300)] 
Simplify proc manager assignment logic

This changes how proc manager handles proc assignment.
Instead of doing this in three different places:
get_proc call handler, return_proc/2 with maybe_assign_proc
and flush_waiters/2, proc manager now just places
all the incoming requests in the waiting queue
and then flushes it.

As a result all the logic kept in one place which makes
it more obvious that we are treating proc management
as a processing of a single FIFO queue
with "soft" and "hard" upper limits.

Consequently this is fixing a bug in maybe_assign_proc
where it was possible to assign a client a process
that wasn't aware of it.

COUCHDB-3095

5 years agoMerge remote branch 'cloudant:3080-fix-validate_dbname'
ILYA Khlopotov [Wed, 10 Aug 2016 19:35:58 +0000 (12:35 -0700)] 
Merge remote branch 'cloudant:3080-fix-validate_dbname'

This closes #188

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
5 years agoFix the case when DbName contains path to db file 188/head
ILYA Khlopotov [Mon, 25 Jul 2016 22:23:30 +0000 (15:23 -0700)] 
Fix the case when DbName contains path to db file

In the case when DbName contains the file name we need to remove .couch
extension in order to match ?DBNAME_REGEX.

COUCHDB-3080

5 years agoFactor out maybe_remove_extension/1 function
ILYA Khlopotov [Mon, 25 Jul 2016 22:22:04 +0000 (15:22 -0700)] 
Factor out maybe_remove_extension/1 function

COUCHDB-3080

5 years agoupdate tests for COUCHDB-3084
Robert Newson [Thu, 4 Aug 2016 09:57:37 +0000 (10:57 +0100)] 
update tests for COUCHDB-3084

5 years agoDon't set "authenticated" if party_mode_handler sets user context 189/head
Robert Newson [Wed, 27 Jul 2016 19:07:23 +0000 (20:07 +0100)] 
Don't set "authenticated" if party_mode_handler sets user context

Patch suggested by Ilya.

COUCHDB-3084

5 years agoStart couch_log for tests
Paul J. Davis [Fri, 22 Jul 2016 12:45:59 +0000 (07:45 -0500)] 
Start couch_log for tests

Now that there's a supervision tree involved we have to start the app to
use it.

5 years agoMerge remote branch 'cloudant:70457-use-couch_epi-decide'
ILYA Khlopotov [Mon, 18 Jul 2016 19:12:44 +0000 (12:12 -0700)] 
Merge remote branch 'cloudant:70457-use-couch_epi-decide'

This closes #187

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
5 years agoName test cases 187/head
ILYA Khlopotov [Mon, 18 Jul 2016 18:52:01 +0000 (11:52 -0700)] 
Name test cases

COUCHDB-3066

5 years agoUse couch_epi:decide for validate_dbname
ILYA Khlopotov [Mon, 18 Jul 2016 18:49:51 +0000 (11:49 -0700)] 
Use couch_epi:decide for validate_dbname

COUCHDB-3066

5 years agoReplace `stale` with `update` in compression tests 186/head
Benjamin Anderson [Sun, 17 Jul 2016 22:51:12 +0000 (15:51 -0700)] 
Replace `stale` with `update` in compression tests

COUCHDB-3063

5 years agotest: use global test timeout macro, should fix test on slow ci vms
Jan Lehnardt [Sat, 16 Jul 2016 10:21:08 +0000 (12:21 +0200)] 
test: use global test timeout macro, should fix test on slow ci vms

5 years agoFix Windows-specific definition
Joan Touzet [Thu, 14 Jul 2016 05:57:27 +0000 (01:57 -0400)] 
Fix Windows-specific definition

5 years agoremove unneded include
Joan Touzet [Thu, 14 Jul 2016 02:39:28 +0000 (22:39 -0400)] 
remove unneded include

5 years agoMerge branch '3040-skip-os-daemon-tests' of https://github.com/wohali/couchdb-couch
Joan Touzet [Wed, 13 Jul 2016 19:58:02 +0000 (15:58 -0400)] 
Merge branch '3040-skip-os-daemon-tests' of https://github.com/wohali/couchdb-couch

5 years agoSkip couchdb_os_daemons_tests on Windows 184/head
Joan Touzet [Wed, 13 Jul 2016 07:52:03 +0000 (03:52 -0400)] 
Skip couchdb_os_daemons_tests on Windows

5 years agoMerge branch '3057-add-couch-js-sleep-test-suite-helper'
Paul J. Davis [Tue, 12 Jul 2016 21:09:03 +0000 (16:09 -0500)] 
Merge branch '3057-add-couch-js-sleep-test-suite-helper'

5 years agoAdd sleep as a test suite function 183/head
Paul J. Davis [Tue, 12 Jul 2016 20:13:47 +0000 (15:13 -0500)] 
Add sleep as a test suite function

This adds a class of test suite functions that are only available when a
command line switch is passed to couchjs. This so that the JavaScript
test suite has access to some helpful additional functions that aren't
part of the JavaScript language.

This particular change only adds a single `sleep` function which takes a
single argument as the number of milliseconds to sleep.

COUCHDB-3057

6 years agoMerge remote branch 'cloudant:remove_upgrade_password_hash'
ILYA Khlopotov [Wed, 6 Jul 2016 21:14:30 +0000 (14:14 -0700)] 
Merge remote branch 'cloudant:remove_upgrade_password_hash'

This closes #182

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
6 years agoRemove maybe_upgrade_password_hash 182/head
ILYA Khlopotov [Wed, 6 Jul 2016 20:51:03 +0000 (13:51 -0700)] 
Remove maybe_upgrade_password_hash

Starting from 411c130ea63c3423d7ea71743095dfb446680da6 we accidentially
upgrading user's password to pbkdf.
Removing upgrade code.

6 years agoMerge remote branch 'cloudant:changes-tests-refactoring'
Eric Avdey [Wed, 6 Jul 2016 14:36:47 +0000 (11:36 -0300)] 
Merge remote branch 'cloudant:changes-tests-refactoring'

This closes #180

Signed-off-by: Eric Avdey <eiri@eiri.ca>
6 years agoFix typo in a test label 180/head
Eric Avdey [Fri, 24 Jun 2016 14:57:42 +0000 (11:57 -0300)] 
Fix typo in a test label

6 years agoMonitor changes consumer in the tests
Eric Avdey [Fri, 24 Jun 2016 14:57:13 +0000 (11:57 -0300)] 
Monitor changes consumer in the tests

6 years agoMerge remote branch 'cloudant:64790-fix-changes-view-filter-for-clustered-access'
Eric Avdey [Wed, 6 Jul 2016 14:25:11 +0000 (11:25 -0300)] 
Merge remote branch 'cloudant:64790-fix-changes-view-filter-for-clustered-access'

This closes #181

Signed-off-by: Eric Avdey <eiri@eiri.ca>
6 years agoAdd fast_view filter to changes clustered access 181/head
Eric Avdey [Fri, 24 Jun 2016 16:32:37 +0000 (13:32 -0300)] 
Add fast_view filter to changes clustered access

A changes feed can be filtered using view's btree
instead of a database btree, a feature known as fast_view.
This feature not implemented on a clustered interface,
however view filter automatically marked as fast_view
when ddoc has option seq_indexed enabled, which leads to
a crash of filtered replication.

This change allows fast_view filter to be processed
as a regular view filter when used on a clustered
interface.

6 years agoAdd the tests for _view filtered changes
Eric Avdey [Fri, 24 Jun 2016 16:31:05 +0000 (13:31 -0300)] 
Add the tests for _view filtered changes