6 months agobump hyper dependency, fix Windows build
Joan Touzet [Wed, 18 Jul 2018 16:15:22 +0000 (12:15 -0400)] 
bump hyper dependency, fix Windows build

6 months agoSwitch fabric attachment receiver to use messages
Nick Vatamaniuc [Tue, 17 Jul 2018 18:53:26 +0000 (14:53 -0400)] 
Switch fabric attachment receiver to use messages

Function closures are fragile and attachment uploads would break if
fabric_doc_attachments is different on any of the nodes in a cluster, like it
might happen during a roling cluster upgrade.

Previously fe53e437ca5ec9d23aa1b55d7934daced157a9e3 introduced two versions of
the module one which handles function closure, other which handled message but
only in this commit messages are starting to be sent.

To avoid breakages in attachemnt uploads during the period of a rolling cluster
upgrade, make sure to upgrade to that commit first then upgrade to this change.

Issue #1394

6 months agoAdd missing default case clause, fixes #1450
Joan Touzet [Tue, 17 Jul 2018 18:00:21 +0000 (14:00 -0400)] 
Add missing default case clause, fixes #1450

6 months agore-raise max_http_request_size to 4GB
Jan Lehnardt [Mon, 16 Jul 2018 08:37:33 +0000 (10:37 +0200)] 
re-raise max_http_request_size to 4GB

6 months agoadd retry to test_request:request()
Jan Lehnardt [Mon, 16 Jul 2018 10:47:23 +0000 (12:47 +0200)] 
add retry to test_request:request()

6 months agoImprove detection of git tags/dirty status
Joan Touzet [Mon, 16 Jul 2018 20:56:52 +0000 (16:56 -0400)] 
Improve detection of git tags/dirty status

Unfortuantely, #1437 brought in a build bug that caused dist tarballs
to be created always using the last tag that could be found on the
tree. This lead to `master` building tarballs labelled `2.1.0`.

The new approach includes extensive comments to explain the approach,
fixes the bug, and for an encore adds -dirty if you're building a
CouchDB with local changes that aren't committed to git.

6 months agoReport git sha on welcome request
Jan Lehnardt [Fri, 13 Jul 2018 12:26:43 +0000 (14:26 +0200)] 
Report git sha on welcome request

Closes #1309

6 months agoMake MD5 hash implementation configurable (#1171)
rokek [Mon, 16 Jul 2018 19:38:07 +0000 (15:38 -0400)] 
Make MD5 hash implementation configurable (#1171)

6 months agoimprove ddoc test reliablilty by waiting for ddoc deletion
Jan Lehnardt [Mon, 16 Jul 2018 10:01:54 +0000 (12:01 +0200)] 
improve ddoc test reliablilty by waiting for ddoc deletion

6 months agoOptionally prevent non-admins from accessing /_all_dbs
Jan Lehnardt [Sat, 14 Jul 2018 10:01:58 +0000 (12:01 +0200)] 
Optionally prevent non-admins from accessing /_all_dbs

6 months agodemote notice to debug logs by @wyc
Jan Lehnardt [Sat, 14 Jul 2018 09:38:49 +0000 (11:38 +0200)] 
demote notice to debug logs by @wyc

6 months agovalidate bind address by @wyc
Jan Lehnardt [Sat, 14 Jul 2018 09:37:12 +0000 (11:37 +0200)] 
validate bind address by @wyc

6 months agoClarify bad index creation error messages
Brandon Gottlob [Wed, 2 May 2018 11:15:55 +0000 (07:15 -0400)] 
Clarify bad index creation error messages

Fixes #927

6 months agowait for db deletion before db re-creation. Closes #1197
Jan Lehnardt [Sat, 14 Jul 2018 10:51:02 +0000 (12:51 +0200)] 
wait for db deletion before db re-creation. Closes #1197

6 months agoraise timeouts in attachment tests
Jan Lehnardt [Sat, 14 Jul 2018 10:54:47 +0000 (12:54 +0200)] 
raise timeouts in attachment tests

6 months agobump deps
Jan Lehnardt [Fri, 13 Jul 2018 15:44:06 +0000 (17:44 +0200)] 
bump deps

6 months agostring:trim() compat for couch_util:trim()
Jan Lehnardt [Sun, 17 Jun 2018 15:17:37 +0000 (17:17 +0200)] 
string:trim() compat for couch_util:trim()

6 months agoUse couch_util:trim for greater erlang compatibility
Robert Newson [Tue, 8 May 2018 18:44:51 +0000 (19:44 +0100)] 
Use couch_util:trim for greater erlang compatibility

6 months agobuild: release candidate tarball should have -RCx
Dave Cottlehuber [Wed, 2 May 2018 09:39:25 +0000 (09:39 +0000)] 
build: release candidate tarball should have -RCx

the released tarball should have -RCx in the name, but not in the
extracted file, otherwise we can't simply rename the final artefact for
our public release.

6 months agobuild: ease pattern matching to be less pedantic about RC
Dave Cottlehuber [Wed, 2 May 2018 08:13:33 +0000 (08:13 +0000)] 
build: ease pattern matching to be less pedantic about RC

git-describe may have changed output formats. The previous regex doesn't
allow any trailing content, and git-describe always appends -g<SHA> unless
abbrev=0 is added.

This approach pulls out only the matching tag, leaving behind any
trailing garbage from git-describe, and as a bonus allows tagging a
commit from within a branch, and running a release directly from the
branch without needing to re-check out the tag itself.

6 months agoconfig: improve handling of admin-supplied changes
Dave Cottlehuber [Mon, 30 Apr 2018 10:10:26 +0000 (10:10 +0000)] 
config: improve handling of admin-supplied changes

- send a readable error response from failed config set
- trust but verify admin-supplied content in separate function
- return specific error conditions for logging

6 months agoDrop Erlang R16 support
Jan Lehnardt [Mon, 9 Jul 2018 14:11:32 +0000 (16:11 +0200)] 
Drop Erlang R16 support

6 months agoReplace R16B03 with 17.5.3 for PR#1427
Joan Touzet [Fri, 13 Jul 2018 15:34:39 +0000 (11:34 -0400)] 
Replace R16B03 with 17.5.3 for PR#1427

6 months agoViews now retain update_seq after compaction.
Jan Lehnardt [Fri, 13 Jul 2018 11:39:28 +0000 (13:39 +0200)] 
Views now retain update_seq after compaction.

Previously on view compaction, the new index state would not carry
over the associated database update and purge sequences. As a
result, views who were compacted at least once could no longer
use the ?update_seq query option, or purge properly.

Closes #984

6 months agohook up proxy auth handler to chttpd
Jan Lehnardt [Fri, 13 Jul 2018 15:17:59 +0000 (17:17 +0200)] 
hook up proxy auth handler to chttpd

6 months agoAdd tests for mango conflict finding
Jan Lehnardt [Fri, 13 Jul 2018 13:08:46 +0000 (15:08 +0200)] 
Add tests for mango conflict finding

I couldn’t find a cleaner way to add _bulk_docs with
`new_edits: false`.

6 months agoAdd `conflicts: true` option to mango selectors
Jan Lehnardt [Sun, 8 Jul 2018 13:48:39 +0000 (15:48 +0200)] 
Add `conflicts: true` option to mango selectors

This allows for using Mango queries for finding docs with conflicts.

Closes #1101

6 months agoAdjust deletion tests in different cluster quorum conditions
jjrodrig [Mon, 9 Jul 2018 21:10:42 +0000 (23:10 +0200)] 
Adjust deletion tests in different cluster quorum conditions

6 months agoDeletion responds 200 after a response from every node, and 202 in other case
jjrodrig [Thu, 29 Mar 2018 21:34:42 +0000 (23:34 +0200)] 
Deletion responds 200 after a response from every node, and 202 in other case

6 months agoFix for issue #1136 - Error 500 deleting DB without quorum
jjrodrig [Thu, 1 Feb 2018 18:31:29 +0000 (19:31 +0100)] 
Fix for issue #1136 - Error 500 deleting DB without quorum

Complete deletion tests with not found

6 months agoMake stem_interactive_updates option work again
Nick Vatamaniuc [Wed, 11 Jul 2018 17:35:25 +0000 (13:35 -0400)] 
Make stem_interactive_updates option work again

After the aebdbc452573f70f4e50d88af5814d0fbe936333 stemming is done separately
from merge so stem interactive option didn't take effect. That is mostly ok as
speed improvements should reduce the need for that option, but it still might
be nice to keep the option (just in case).

Also, a nice side effect is it removes an extra external function from
couch_key_tree module and simplifies the tests a bit.

Related PR: #958

6 months agoAdded tests for checking http status code depending on cluster quorum
jjrodrig [Fri, 9 Feb 2018 09:22:10 +0000 (10:22 +0100)] 
Added tests for checking http status code depending on cluster quorum

6 months agofeat: remove duplicate authentication check
Jan Lehnardt [Tue, 27 Mar 2018 14:29:32 +0000 (16:29 +0200)] 
feat: remove duplicate authentication check

6 months agofeat: avoid double builds on PRs
Jan Lehnardt [Sun, 8 Jul 2018 13:57:34 +0000 (15:57 +0200)] 
feat: avoid double builds on PRs

6 months agoallow socket server configuration for TLS httpd
Jan Lehnardt [Fri, 29 Jun 2018 17:31:44 +0000 (19:31 +0200)] 
allow socket server configuration for TLS httpd

6 months agoremove mention of os daemons and externals in ini files
Jan Lehnardt [Wed, 16 May 2018 16:44:16 +0000 (18:44 +0200)] 
remove mention of os daemons and externals in ini files

6 months agoDon't set context for compaction files during db delete (#1419)
Eric Avdey [Fri, 29 Jun 2018 21:31:55 +0000 (18:31 -0300)] 
Don't set context for compaction files during db delete (#1419)

When we delete files with context option set to `delete`,
`couch_file` respects configuration flag "enable_database_recovery"
and just renames the files in case it's set to true.

This change removes context for compaction files deleted
during database deletion to make sure we are actually
erasing them and not just renaming and leaving behind.

6 months agoMerge pull request #1401 from Spotme/spotme/fix/couch-native-process
iilyak [Fri, 29 Jun 2018 19:37:48 +0000 (12:37 -0700)] 
Merge pull request #1401 from Spotme/spotme/fix/couch-native-process

Fix for a function_clause crash in the couch_native_process for Erlang views

6 months agotests(couch_changes): add tests for changes feed filtering using an Erlang view 1401/head
AlexanderKaraberov [Wed, 20 Jun 2018 15:49:18 +0000 (17:49 +0200)] 
tests(couch_changes): add tests for changes feed filtering using an Erlang view

6 months agofix(_view changes feed): fix function_clause crash in couch_native_process.
AlexanderKaraberov [Thu, 31 May 2018 08:23:40 +0000 (10:23 +0200)] 
fix(_view changes feed): fix function_clause crash in couch_native_process.
Crash was caused by a missing implementation of ddoc function for <<"views">> FunPath, implementation is based on FilterFun but matches return values of the erlang:put()  which is called in the native Emit function and also expects ok and false when docs were not emitted.

6 months agoAdd regression runs on new dedicated FreeBSD VM
Joan Touzet [Wed, 27 Jun 2018 00:45:23 +0000 (20:45 -0400)] 
Add regression runs on new dedicated FreeBSD VM

Thanks to Just Some Enterprises for donating the compute power!

6 months agoUpdate build dependency docs for FreeBSD
Joan Touzet [Wed, 27 Jun 2018 00:03:31 +0000 (20:03 -0400)] 
Update build dependency docs for FreeBSD

6 months agoUpdate snappy dep to CouchDB-1.0.1 with 21.0 support
Nick Vatamaniuc [Thu, 21 Jun 2018 18:07:25 +0000 (14:07 -0400)] 
Update snappy dep to CouchDB-1.0.1 with 21.0 support

Issue #1396

6 months agoAdd constant index fields to sort based on the selector (#1376)
garren smith [Wed, 20 Jun 2018 19:12:27 +0000 (21:12 +0200)] 
Add constant index fields to sort based on the selector (#1376)

This moves the sort check into the is_usable function for all indexes.
For map/reduce indexes it can add any constant fields e.g {a: {"$eq": 4}
to the prefix of the sort because it won't affect the actual sort but
will increase the chance that an index is selected. This is a user
experience fix to help a user if they don't add all the columns for an
index to the sort fields.

6 months agoPrepare to fabric attachment receiver from a fun closure to a tuple
Nick Vatamaniuc [Tue, 19 Jun 2018 19:05:00 +0000 (15:05 -0400)] 
Prepare to fabric attachment receiver from a fun closure to a tuple

Passing closures around is fragile and prevents smooth upgrading. Instead pass
a tuple with a data from the receiver closure explicitly and convert to back to
a local fun locally on each node.

This is a preparatory commit before the switch. To ensure attachment uploading
requests are successful, would need to first install this change on all the
nodes. Then in a separate upgrade step, switch fabric.erl to call
fabric_doc_atts:receiver instead fabric_doc_attatchments:recevier.

6 months agorefactor process_request to not drop req (#1375)
Tony Sun [Tue, 19 Jun 2018 16:49:24 +0000 (09:49 -0700)] 
refactor process_request to not drop req (#1375)

Previously, when we fail authorization but pass authentication, we use
the old HttpReq which drops user_ctx. This change leaves user_ctx.

6 months agoCall `set_mqd_off_heap` for critical processes
Paul J. Davis [Mon, 18 Jun 2018 17:39:30 +0000 (12:39 -0500)] 
Call `set_mqd_off_heap` for critical processes

This uses the new `couch_util:set_mqd_off_heap/0` function to set
message queues to off_heap for some of our critical processes that
receive a significant amount of load in terms of message volume.

6 months agoAdd set_mqd_off_heap utility function
Paul J. Davis [Mon, 18 Jun 2018 17:34:02 +0000 (12:34 -0500)] 
Add set_mqd_off_heap utility function

In Erlang VMs starting with version 19.0 have a new process_flag to
store messages off the process heap. This is extremely useful for
processes that can have huge numbers of messages in their mailbox. For
CouchDB this is most usually observed when couch_server backs up with a
large message queue which wedges the entire node.

This utility function will set a process's message_queue_data flag to
off_heap in a way that doesn't break builds of CouchDB on older Erlang
VMs while automatically enabling the flag on VMs that do support it.

7 months agoFix couch_key_tree_tests.erl
Paul J. Davis [Wed, 13 Jun 2018 18:35:00 +0000 (13:35 -0500)] 
Fix couch_key_tree_tests.erl

The `should_merge_tree_to_itself` and `should_merge_tree_of_odd_length`
tests were both invalid as merging does not support merging of anything
other than a linear path. This failure was covered up by the fact that
the stem operation will detect and cover up any errors from a failed

Co-Authored-By: Nick Vatamaniuc <>
7 months agoOptimize couch_key_tree:stem/2
Paul J. Davis [Wed, 13 Jun 2018 18:15:11 +0000 (13:15 -0500)] 
Optimize couch_key_tree:stem/2

This is two related optimizations for stemming revisions. The first
optimization re-writes the stemming algorithm to drop it from an O(N^2)
to O(N) operation by using a depth first search through the tree and
tracking which revisions are within `revs_limit` revs from a leaf
dropping any revision that exceeds that limit.

The second optimization is just that we avoid calling stemming more
often than necessary by switching away from using `merge/3` to `merge/2`
and then calling `stem/2` only when necessary.

Co-Authored-By: Nick Vatamaniuc <>
7 months agoFix active size calculations for views
Paul J. Davis [Fri, 15 Jun 2018 16:44:20 +0000 (11:44 -0500)] 
Fix active size calculations for views

It was brought to my attention that the active size looked a bit funny
occasionally as it could be larger than the file size. Given that active
size is defined to be the number of bytes used in a view file it must be
strictly greater than or equal to zero as well as less than or equal to
file size. Thus the great hunt had begun!

While I'd love more than anything to regail you, Dear Reader, with the
tales, the joys, the highs, and yes, even the lows of this search, it
turns out that I cannot. I must not. For there were none!

Turns out this was a trivial bug where we were re-using the ExternalSize
calculation instead of applying `couch_btree:size/1` to all of the
btrees in the `#mrview` records. Simple bug comes with a correspondingly
simple fix.

I also noticed that the info tests were broken and not being run so I
spent a few minutes cleaning those up to make the various assumptions.

7 months agoMerge pull request #1387 from cloudant/make-bin_opt_info-optional
Eric Avdey [Fri, 15 Jun 2018 12:21:56 +0000 (09:21 -0300)] 
Merge pull request #1387 from cloudant/make-bin_opt_info-optional

Add compile's command line options, introduce `ERL_OPTS` and make `bin_opt_info` optional.

7 months agoAllow custom compile options with env variable 1387/head
Eric Avdey [Thu, 14 Jun 2018 17:28:25 +0000 (14:28 -0300)] 
Allow custom compile options with env variable

7 months agoMake bin_opt_info optional based on env variable
Eric Avdey [Thu, 14 Jun 2018 13:24:55 +0000 (10:24 -0300)] 
Make bin_opt_info optional based on env variable

7 months agoRemove debug_info from compile options
Eric Avdey [Mon, 11 Jun 2018 14:32:56 +0000 (11:32 -0300)] 
Remove debug_info from compile options

Flag `debug_info` auto-propagated from rebar,
so there are no need to set it manually or we'll
end up with a double entry in opts.

7 months agoAdd compile's command line options
Eric Avdey [Mon, 11 Jun 2018 14:24:33 +0000 (11:24 -0300)] 
Add compile's command line options

Allow to compile a specified list of apps.
Fix for eunit's OPTS regexp on systems
with sed withouth GNU extension (i.e MacOS)

7 months agoRevert "Introduce bin_opt_info erl_opts compilation option"
Eric Avdey [Mon, 11 Jun 2018 12:10:58 +0000 (09:10 -0300)] 
Revert "Introduce bin_opt_info erl_opts compilation option"

This reverts commit b58021e6d9751fa36a4164974664e86248d444fd.

7 months agoUpdate skip_deps for 3rd parties eunit (#1386)
Eric Avdey [Thu, 14 Jun 2018 13:18:28 +0000 (10:18 -0300)] 
Update skip_deps for 3rd parties eunit (#1386)

7 months agoJenkinsfile: typo
Joan Touzet [Mon, 11 Jun 2018 08:19:10 +0000 (01:19 -0700)] 
Jenkinsfile: typo

7 months agoFix container for package-building step
Joan Touzet [Sat, 9 Jun 2018 17:31:40 +0000 (10:31 -0700)] 
Fix container for package-building step

7 months agoIgnore trailing characters in a builtin reduce
Adam Kocoloski [Thu, 7 Jun 2018 03:11:49 +0000 (23:11 -0400)] 
Ignore trailing characters in a builtin reduce

What a kooky idea, but I guess we're committed to it.

7 months agoUse finalize operation to simplify _stats
Adam Kocoloski [Wed, 6 Jun 2018 22:10:12 +0000 (18:10 -0400)] 
Use finalize operation to simplify _stats

Rather than packing the stats into an ejson object on each write
we use a more compact tuple format on disk and then turn it into
ejson at query time.

7 months agoFinalize in couch_mrview, but make it optional
Adam Kocoloski [Thu, 7 Jun 2018 02:08:40 +0000 (22:08 -0400)] 
Finalize in couch_mrview, but make it optional

If we're in a cluster, finalization runs at the coordinator. Otherwise,
couch_mrview can run it directly to simplify things for consumers.

7 months agoAdd hyper app to dependencies
Nick Vatamaniuc [Fri, 8 Jun 2018 05:38:44 +0000 (01:38 -0400)] 
Add hyper app to dependencies

Releases and dialyzer checks need app dependencies to work properly

Issue: #1346

7 months agoAdd _approx_count_distinct as a builtin reduce function (#1346)
Adam Kocoloski [Wed, 6 Jun 2018 01:45:31 +0000 (21:45 -0400)] 
Add _approx_count_distinct as a builtin reduce function (#1346)

This introduces a new builtin reduce function, which uses a HyperLogLog
algorithm to estimate the number of distinct keys in the view index. The
precision is currently fixed to 2^11 observables andtherefore uses
approximately 1.5 KB of memory.

It also introduces a finalize step which can be used to improve the
efficiency of other builtin reduce functions going forward.

Closes COUCHDB-2971

7 months agoUpdate Jenkins build process:
Joan Touzet [Mon, 28 May 2018 06:30:32 +0000 (02:30 -0400)] 
Update Jenkins build process:

* Newly provisioned images
* Add ubuntu bionic (18.04) support
* Add our own couch-js/couch-libmozjs185 pkgs to rolling repo build

7 months agoMango: _id and _rev index selection
Will Holley [Wed, 23 May 2018 14:01:49 +0000 (15:01 +0100)] 
Mango: _id and _rev index selection

Mango requires that a JSON index can only be used to fulfil
a query if the "selector" field covers all of the fields the
index. For example, if an index contains ["a", "b"] but the
selector only requires field ["a"] to exist in the matching documents,
the index would not be valid for the query (because it only includes
documents containing both "a" and "b").

There is a special case here around built-in fields; _id and _rev
specifically, because they are guaranteed to exist in any matching

If a user declares an index ["a", "_id"], we can safely exclude "_id"
from the index coverage check, so a selector of {"a": "foo"} should be
able to use this index.

Prior to this commit, a user would have to alter the selector so that
it covered the "_id" field, e.g. {"a": "foo",
"_id": {"$exists": true}}. The commit removes the need to explicitly
cover _id or _rev fields in the query selector.

8 months agoAdd SSL session_lifetime limit for ibrowse pids
Joan Touzet [Thu, 10 May 2018 16:59:57 +0000 (12:59 -0400)] 
Add SSL session_lifetime limit for ibrowse pids

8 months agoBump fauxton to fix CI builds
Joan Touzet [Wed, 2 May 2018 03:38:37 +0000 (23:38 -0400)] 
Bump fauxton to fix CI builds

8 months agoForce use of SMP enabled BEAM VM, fixes #1296
Joan Touzet [Sun, 29 Apr 2018 20:00:18 +0000 (16:00 -0400)] 
Force use of SMP enabled BEAM VM, fixes #1296

9 months agoFix length badarg error in mp parser
Nick Vatamaniuc [Tue, 17 Apr 2018 23:51:01 +0000 (19:51 -0400)] 
Fix length badarg error in mp parser

This was introduced in:

Issue #1286

9 months agoFix mem3 tests (#1285)
Eric Avdey [Tue, 17 Apr 2018 17:04:39 +0000 (14:04 -0300)] 
Fix mem3 tests (#1285)

The changes listener started in setup of mem3_shards test
was crashing when tried to register on unstarted couch_event
server, so the test was either fast enough to do assertions
before of that or failed on dead listener process.

This change removes dependency on mocking and uses
a standard test_util's star and stop of couch. Module start
moved into the test body to avoid masking potential failure
in a setup.

Also the tests mem3_sync_security_test and mem3_util_test
been modified to avoid setup and teardown side effects.

9 months agoDocument enable_database_recovery ini option
Joan Touzet [Fri, 13 Apr 2018 18:37:10 +0000 (14:37 -0400)] 
Document enable_database_recovery ini option

9 months agoMerge pull request #1273 from cloudant/adopt-fake_db-to-PSE
Eric Avdey [Fri, 13 Apr 2018 14:09:45 +0000 (11:09 -0300)] 
Merge pull request #1273 from cloudant/adopt-fake_db-to-PSE

Adopt fake_db to PSE changes

9 months agoAdopt fake_db to PSE changes 1273/head
Eric Avdey [Mon, 9 Apr 2018 17:30:38 +0000 (14:30 -0300)] 
Adopt fake_db to PSE changes

With db headers moved into engine's state, any fake_db call,
that's trying to setup sequences for tests (e.g. in mem3_shards)
crashing with context setup failed.

It's not trivial to compose a proper `engine` field outside of
couch app, so instead this fix makes fake_db to set engine
transparently, unless it was provided in a payload.

9 months agoIn _scheduler/docs fix `crashing` state showing as `pending` sometimes
Nick Vatamaniuc [Tue, 10 Apr 2018 14:31:53 +0000 (10:31 -0400)] 
In _scheduler/docs fix `crashing` state showing as `pending` sometimes

Replication jobs are backed off based on the number of consecutive crashes,
that is, we count the number of crashes in a row and then penalize jobs with an
exponential wait based that number. After a job runs without crashing for 2
minutes, we consider it healthy and stop going back in its history and looking
for crashes.

Previously a job's state was set to `crashing` only if there were any
consecutive errors. So it could have ran for 3 minutes, then user deletes the
source database, job crashes and stops. Until it runs again the state would
have been shown as `pending`. For internal accounting purposes that's correct
but it is confusing for the user because the last event in its history is a

This commit makes sure that if the last even in job's history is a crash user
will see the jobs as `crashing` with the respective crash reason. The
scheduling algorithm didn't change.

Fixes #1276

9 months agoMerge pull request #1281 from apache/commit_data_pse
Robert Newson [Thu, 12 Apr 2018 17:02:56 +0000 (18:02 +0100)] 
Merge pull request #1281 from apache/commit_data_pse

call commit_data where needed

9 months agocall commit_data where needed 1281/head
Robert Newson [Thu, 12 Apr 2018 16:26:28 +0000 (17:26 +0100)] 
call commit_data where needed

Regression since introduction of PSE

9 months agoSet update_lru_on_read=false as default
Joan Touzet [Fri, 19 Jan 2018 20:22:23 +0000 (15:22 -0500)] 
Set update_lru_on_read=false as default

9 months agoMinor documentation cleanup for couch_replicator
Kyle Snavely [Mon, 9 Apr 2018 19:48:10 +0000 (15:48 -0400)] 
Minor documentation cleanup for couch_replicator

9 months agoSwitch to using a mirrored triq dependency
Nick Vatamaniuc [Mon, 9 Apr 2018 16:18:51 +0000 (12:18 -0400)] 
Switch to using a mirrored triq dependency

9 months agoDo not drop updated httpdb record after auth headers are updated
Nick Vatamaniuc [Fri, 6 Apr 2018 16:16:43 +0000 (12:16 -0400)] 
Do not drop updated httpdb record after auth headers are updated

In replicator, after client auth plugin updates headers it could also update
its private context. Make sure to pass the updated httpdb record along to
response processing code.

For example, session plugin updates the epoch number in its context, and it
needs the epoch number later in response processing to make the decision
whether to refresh the cookie or not.

9 months agoKill fabric attachment receiver when middleman times out
Nick Vatamaniuc [Tue, 3 Apr 2018 23:13:35 +0000 (19:13 -0400)] 
Kill fabric attachment receiver when middleman times out

Attachment receiver process is started with a plain spawn. If middleman process
dies, receiver would hang forever waiting on receive. After a long enough time
quite a few of these receiver processes could accumulate on a server.

Fixes #1264

9 months agoKey tree property tests
Nick Vatamaniuc [Fri, 2 Feb 2018 17:08:08 +0000 (12:08 -0500)] 
Key tree property tests

Key tree module is a candidate to use property tests on as it mostly deals with
manipulating a single data structure and functions are referentially
transparent, that is, they aren't many side-effects like IO for example.

The test consists of two main parts - generators and properties.

Generators generate random input, for example revision trees, and properties
check that certain properties hold, for example that after stemming all the
leaves are still present in the revtree.

To run the test:

make eunit apps=couch suites=couch_key_tree_prop_tests

9 months agoFix typo in node local _replicate handler
Nick Vatamaniuc [Mon, 2 Apr 2018 21:24:57 +0000 (17:24 -0400)] 
Fix typo in node local _replicate handler

Dialyzer run discovered:

Unknown function couch_replicator_httpd_utils:validate_rep_props/1

Indeed, the function should be

9 months agofix file_compression value description
Serge A. Salamanka [Fri, 30 Mar 2018 07:05:31 +0000 (10:05 +0300)] 
fix file_compression value description

deflate_N value is more clear description and obvious to replace only N. the same description is in documentation.

9 months agoTest compaction resumption after error
Paul J. Davis [Thu, 29 Mar 2018 17:19:11 +0000 (12:19 -0500)] 
Test compaction resumption after error

9 months agoFix compaction resumption for the BT engine
Paul J. Davis [Thu, 29 Mar 2018 16:02:25 +0000 (11:02 -0500)] 
Fix compaction resumption for the BT engine

This bug prevents the proper resumption of compactions that died during
the meta copy phase. The issue is that we were setting the update_seq
but not copying over the id and seq tree states. Thus when compaction
resumed from the bad files we'd end up skipping the part where we copy
docs over and then think everything was finished. Thus completely
clearing a database of its contents.

Luckily this isn't release code and as such should have fairly minimal
impact other than those who might be running off master.

9 months agoMake loginUser wait for successful authentication
Eric Avdey [Thu, 29 Mar 2018 16:44:29 +0000 (13:44 -0300)] 
Make loginUser wait for successful authentication

9 months agoFix killing of OS processes
Paul J. Davis [Wed, 28 Mar 2018 20:59:29 +0000 (15:59 -0500)] 
Fix killing of OS processes

This was a latent bad merge that failed to remove the duplicate receive
statement. This ended up discarding the monitor's 'DOWN' message which
leads to an infinite loop in couch_os_proces:killer/1.

9 months agoFix shard substitution in changes feeds
Paul J. Davis [Tue, 27 Mar 2018 15:55:48 +0000 (10:55 -0500)] 
Fix shard substitution in changes feeds

9 months agofeat: add debug log output for shard open errors
Jan Lehnardt [Tue, 27 Mar 2018 14:11:12 +0000 (16:11 +0200)] 
feat: add debug log output for shard open errors

9 months agoadd test covering loading admins from config
Jan Lehnardt [Wed, 28 Mar 2018 10:33:40 +0000 (12:33 +0200)] 
add test covering loading admins from config

9 months agofix: more reliable password scheme tests
Jan Lehnardt [Wed, 28 Mar 2018 13:13:21 +0000 (15:13 +0200)] 
fix: more reliable password scheme tests

Closes #1238

1. log errors from waitForSuccess
2. log errors in testFun()
3. spinloop replaces arbitrary wait timeout

9 months agoFix couch peruser test suite (#1247)
Eric Avdey [Wed, 28 Mar 2018 12:08:43 +0000 (09:08 -0300)] 
Fix couch peruser test suite (#1247)

* Fix binary optimization warning

* Use proper config delete in couch_peruser_test

* Fix weird spacing

* Use test_util's wait in tests instead of custom one

* Remove obsolete constant

* Make get_security to wait for proper sec object

9 months agoMerge pull request #1240 from apache/cleanup
Joan Touzet [Tue, 27 Mar 2018 20:42:37 +0000 (16:42 -0400)] 
Merge pull request #1240 from apache/cleanup

Various top-level directory cleanups

9 months agoVarious top-level directory cleanups 1240/head
Joan Touzet [Mon, 26 Mar 2018 22:14:49 +0000 (18:14 -0400)] 
Various top-level directory cleanups

* Replace list of committers with link to ASF page showing committer list
* Move introspect escript to build-aux/, update Makefiles to match
* Remove unmaintained Vagrantfile, if a new maintainer steps up we can revisit
* Remove obsolete license.skip file, was used for auto-header insertion

9 months agoMerge pull request #1242 from apache/daemon-spaces
Joan Touzet [Tue, 27 Mar 2018 18:24:23 +0000 (14:24 -0400)] 
Merge pull request #1242 from apache/daemon-spaces

Allow couch_os_daemons to live in directories with spaces

9 months agoMerge branch 'master' into daemon-spaces 1242/head
Joan Touzet [Tue, 27 Mar 2018 07:06:39 +0000 (03:06 -0400)] 
Merge branch 'master' into daemon-spaces

9 months agoMerge pull request #1243 from apache/import-setup-again
Joan Touzet [Tue, 27 Mar 2018 07:05:27 +0000 (03:05 -0400)] 
Merge pull request #1243 from apache/import-setup-again

Import couchdb-setup application