8 years agoConditionally apply JSON encoding to update_seq values
Robert Newson [Wed, 9 Nov 2011 13:08:49 +0000 (13:08 +0000)]
Conditionally apply JSON encoding to update_seq values

BigCouch 0.3 cannot parse requests of the form /db/_changes?since="123-foo" so
the recent ?JSON_ENCODE addition to Since in two places causes 0.3 <-> 0.4
replication to fail with json_encode/badterm errors.

This patch applies JSON encoding only when the Since value is not already a
binary (i.e, when it's a [integer(), binary()]) and interop is restored.

BugzID: 12833

8 years agoUpdate troubleshooting link
Adam Kocoloski [Tue, 8 Nov 2011 16:58:50 +0000 (11:58 -0500)]
Update troubleshooting link

8 years agoSimplify README
Adam Kocoloski [Tue, 8 Nov 2011 16:00:30 +0000 (11:00 -0500)]
Simplify README

8 years agoFix retrieval of headers larger than 4k
Adam Kocoloski [Wed, 26 Oct 2011 18:04:54 +0000 (14:04 -0400)]
Fix retrieval of headers larger than 4k

Our headers start with a <<1>> and then four bytes indicating the length
of the header and its checksum. When the header is larger than 4090
bytes it will be split across multiple blocks in the file and will need
to be reassembled on read. The reassembly consists of stripping out
<<0>> from the beginning of each subsequent block in the
remove_block_prefixes/2 function. The bug here is that we tell
remove_block_prefixes that we're starting 1 byte into the current block
instead of 5, so it ends up removing one good byte from the header and
injecting one or more random <<0>>s.

Headers larger than 4k are very rare and generally require a view group
with a huge number of indexes or indexes with fairly large reductions,
which explains why this bug has gone undetected until now.

Closes COUCHDB-1319.

8 years agoFix SpiderMonkey source evaluation
Paul J. Davis [Mon, 24 Oct 2011 20:07:57 +0000 (15:07 -0500)]
Fix SpiderMonkey source evaluation

Looks like we had a couple commits get crossed over during the merges.
This removes the original version of the patch that wrapped JS functions
with parens.

8 years agoFix object sealing with spidermonkey 1.7.0
Robert Newson [Thu, 20 Oct 2011 17:03:46 +0000 (18:03 +0100)]
Fix object sealing with spidermonkey 1.7.0

8 years agoMerge pull request #76 from cloudant/12741-replication-seq-format
Adam Kocoloski [Tue, 18 Oct 2011 15:35:07 +0000 (08:35 -0700)]
Merge pull request #76 from cloudant/12741-replication-seq-format

8 years agoRevert "Build couchjs with C, not C++. Fixes libm error on CentOS."
Robert Newson [Mon, 17 Oct 2011 21:12:51 +0000 (22:12 +0100)]
Revert "Build couchjs with C, not C++. Fixes libm error on CentOS."

This reverts commit e311d45fba617e7917d76109b4e21dbb388f268d.

Turns out the 'libm' error is a very obscure way of reporting a lack
of a c++ compiler.

8 years agoFix seq problem in full_uri by encoding
Bob Dionne [Mon, 17 Oct 2011 20:31:53 +0000 (16:31 -0400)]
Fix seq problem in full_uri by encoding


8 years agoBuild couchjs with C, not C++. Fixes libm error on CentOS.
Robert Newson [Mon, 17 Oct 2011 19:23:25 +0000 (20:23 +0100)]
Build couchjs with C, not C++. Fixes libm error on CentOS.

8 years agoremove scons cache in 'make clean'
Robert Newson [Mon, 17 Oct 2011 17:33:52 +0000 (18:33 +0100)]
remove scons cache in 'make clean'

8 years agoMerge pull request #72 from cloudant/12730-add-remsh-script
Paul J. Davis [Thu, 13 Oct 2011 22:28:00 +0000 (15:28 -0700)]
Merge pull request #72 from cloudant/12730-add-remsh-script

Add a remsh script for each node

BugzId: 12730

8 years agoImprove remsh script
Paul J. Davis [Wed, 12 Oct 2011 23:10:04 +0000 (18:10 -0500)]
Improve remsh script

Cookies now default to using ~/.erlang.cookie which is automatically
generated if it does not exist when erlang starts with a name.

There is also no longer a need to specify a name to remsh as it'll
generate a name based on the process id and set the short or long
version appropriately.

8 years agoMerge pull request #74 from cloudant/7c04f93
Adam Kocoloski [Thu, 13 Oct 2011 18:10:24 +0000 (11:10 -0700)]
Merge pull request #74 from cloudant/7c04f93

Fix badarg error in couch_server:try_close_lru/1

BugzID: 12363

8 years agoFix badarg error in couch_server:try_close_lru/1
Paul J. Davis [Thu, 13 Oct 2011 06:44:26 +0000 (01:44 -0500)]
Fix badarg error in couch_server:try_close_lru/1

The race condition in couch_server's ets table usage rears its ugly head
by leaving an entry in couch_lru. This patch just addresses the issue by
allowing the client pid to use the db and ignores the fact that for the
duration its over the max_dbs_open setting.

8 years agoMerge pull request #71 from cloudant/12726-custom-http-options
Adam Kocoloski [Wed, 12 Oct 2011 18:20:07 +0000 (11:20 -0700)]
Merge pull request #71 from cloudant/12726-custom-http-options

8 years agoRemove obsolete options, document N,Q
Adam Kocoloski [Wed, 12 Oct 2011 17:17:11 +0000 (13:17 -0400)]
Remove obsolete options, document N,Q

8 years agoAdd a remsh command to BigCouch
Paul J. Davis [Wed, 12 Oct 2011 03:06:58 +0000 (22:06 -0500)]
Add a remsh command to BigCouch

The remsh pattern is quite useful for connecting to running nodes for
debugging production issues. This adds a small script that lets users
connect quickly to a running node.

8 years agoDocument custom HTTP/socket options in default.ini
Paul J. Davis [Wed, 12 Oct 2011 00:55:58 +0000 (19:55 -0500)]
Document custom HTTP/socket options in default.ini

Part of the backport of COUCHDB-1008 to chttpd. This just updates
the default.ini with some commented out options describing their
availability to users.

8 years agoRemove call to subprocess.check_output
Paul J. Davis [Tue, 11 Oct 2011 00:16:01 +0000 (19:16 -0500)]
Remove call to subprocess.check_output

This function is new in Python 2.7 and we already have a function that
returns command ouput. Just reuse runcmd to get the version.

8 years agoMerge remote-tracking branch 'apache/1.1.x'
Robert Newson [Mon, 10 Oct 2011 16:55:50 +0000 (17:55 +0100)]
Merge remote-tracking branch 'apache/1.1.x'

8 years agoInclude twig explicitly in the release config
Adam Kocoloski [Fri, 7 Oct 2011 22:36:36 +0000 (18:36 -0400)]
Include twig explicitly in the release config

This fixes "Unable to generate spec" errors when trying to build a
release on Erlang/OTP R13.

8 years agoRevert "Fix function evaluation by newer SpiderMonkey's."
Robert Newson [Thu, 6 Oct 2011 19:49:48 +0000 (20:49 +0100)]
Revert "Fix function evaluation by newer SpiderMonkey's."

This reverts commit 61f10e7590bd352b367ad426a56587cbef3700b6.

8 years agoRevert "Remove SpiderMonkey 1.8.5 compatibility"
Robert Newson [Thu, 6 Oct 2011 19:49:17 +0000 (20:49 +0100)]
Revert "Remove SpiderMonkey 1.8.5 compatibility"

This reverts commit 5b558c81ed9709fb286a6821e9ae6d6478012c2c.

8 years agofix shadowing warning.
Robert Newson [Thu, 6 Oct 2011 09:46:04 +0000 (10:46 +0100)]
fix shadowing warning.

8 years agoRemove SpiderMonkey 1.8.5 compatibility
Robert Newson [Thu, 6 Oct 2011 09:39:21 +0000 (10:39 +0100)]
Remove SpiderMonkey 1.8.5 compatibility

This commit reverts 1.8.5 compatibility including the corresponding couchjs
paren hack as this leads to significant breakage in existing functions.

8 years agoUpdate CHANGES and NEWS for the 1.1.1 release
Filipe David Manana [Wed, 5 Oct 2011 13:58:25 +0000 (14:58 +0100)]
Update CHANGES and NEWS for the 1.1.1 release

8 years agoupdate CHANGES and NEWS to include a one line summary for every ticket resolved in...
Robert Newson [Wed, 5 Oct 2011 12:50:50 +0000 (13:50 +0100)]
update CHANGES and NEWS to include a one line summary for every ticket resolved in 1.1.1

8 years agoMerge pull request #67 from cloudant/12645-merge_latest_1.1.x
Adam Kocoloski [Tue, 4 Oct 2011 20:11:12 +0000 (13:11 -0700)]
Merge pull request #67 from cloudant/12645-merge_latest_1.1.x

8 years agoMerge remote branch 'apache/1.1.x'
Adam Kocoloski [Tue, 4 Oct 2011 16:22:45 +0000 (12:22 -0400)]
Merge remote branch 'apache/1.1.x'

8 years agofix couchjs help language and use short options
Randall Leeds [Sun, 2 Oct 2011 21:04:27 +0000 (14:04 -0700)]
fix couchjs help language and use short options

8 years agodistclean couchjs.1 help2man file
Randall Leeds [Sun, 2 Oct 2011 11:31:14 +0000 (04:31 -0700)]
distclean couchjs.1 help2man file

8 years agoimprove argument parsing in couchjs
Randall Leeds [Sun, 2 Oct 2011 11:11:54 +0000 (04:11 -0700)]
improve argument parsing in couchjs

This change makes argument parsing in couchjs more robust:
  * Removes the need for couchjs script
  * Adds long options
  * Makes all the options to couchjs available (fix COUCHDB-893)



8 years agofix COUCHDB-648 - _update handler ignores "code"
Randall Leeds [Sat, 1 Oct 2011 03:20:05 +0000 (03:20 +0000)]
fix COUCHDB-648 - _update handler ignores "code"

Test by Christian Carter
This is a backport of r1177890

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoReplicator: skip documents with empty ID
Filipe David Borba Manana [Fri, 30 Sep 2011 08:10:31 +0000 (08:10 +0000)]
Replicator: skip documents with empty ID

Due to a bug, older releases allowed the creation of
documents with an empty ID, which are impossible to
GET therefore making the replicator crash.
This change simply skips such documents and logs
an error message to inform users.

This is a backport of revision 1177548 from trunk.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRemove usage of http module from etap tests
Filipe David Borba Manana [Thu, 29 Sep 2011 23:34:40 +0000 (23:34 +0000)]
Remove usage of http module from etap tests

This module is deprecated in OTP R15, which is going to
be released by the end of this year.
The etap tests now use ibrowse instead.

This is a backport of revision 1177459 from trunk.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agorestore update_group for better update_after implementation.
Robert Newson [Thu, 29 Sep 2011 14:49:47 +0000 (15:49 +0100)]
restore update_group for better update_after implementation.

8 years agopermit . within database names to allow shard browsing on :5986
Robert Newson [Wed, 28 Sep 2011 21:49:32 +0000 (22:49 +0100)]
permit . within database names to allow shard browsing on :5986

8 years agohandle bigcouch sequences in futon.browse.js
Robert Newson [Wed, 28 Sep 2011 21:12:51 +0000 (22:12 +0100)]
handle bigcouch sequences in futon.browse.js

8 years agoMerge 1.1.x because Paul Davis kept his important bug fix super secret while I was...
Robert Newson [Wed, 28 Sep 2011 20:19:15 +0000 (21:19 +0100)]
Merge 1.1.x because Paul Davis kept his important bug fix super secret while I was slaving away on this merge for two days.

8 years agoremove bad new tests. evil tests, I keel you.
Robert Newson [Wed, 28 Sep 2011 20:09:27 +0000 (21:09 +0100)]
remove bad new tests. evil tests, I keel you.

8 years agoMerge 1.1.x changes
Robert Newson [Wed, 28 Sep 2011 10:18:06 +0000 (11:18 +0100)]
Merge 1.1.x changes


BugzID: 12645

8 years agoRest of the fix for COUCHDB-1265
Paul Joseph Davis [Wed, 28 Sep 2011 03:44:25 +0000 (03:44 +0000)]
Rest of the fix for COUCHDB-1265

As a follow up to COUCHDB-1265 I was missing the fact that after the
insertion of a new update_seq into an internal node it is quite possible
that a compaction runs before the doc is updated again. This is
important because compaction removes information of the largest update
seq from the tree itself.

The fix is simple to include the update_seq from the #full_doc_info{}
record when calculating #doc_info.high_seq. The way to think of this
is that it's the maximum value from all known values for the update
sequence which can be defined as all values known in the tree or in the
full_doc_info record.

Backport of r1176701 from trunk

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAllow CommonJS modules to be an empty string.
Paul Joseph Davis [Wed, 28 Sep 2011 01:14:56 +0000 (01:14 +0000)]
Allow CommonJS modules to be an empty string.

We were making a typical JavaScript mistake testing a module for
truthiness instead of checking that it was undefined.

Fixes COUCHDB-1223
Backport of r1176677 from trunk

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix function evaluation by newer SpiderMonkey's.
Paul Joseph Davis [Tue, 27 Sep 2011 23:59:11 +0000 (23:59 +0000)]
Fix function evaluation by newer SpiderMonkey's.

Found this error using the Debian package for SM 1.8.5 and have since
had reports of users seeing it as well. The basic error is that some
versions of SpiderMonkey appear to dislike this call to eval:


The fix is simply to wrap the function source in parenthesis so that
SM is convinced that it knows how to evaluate a function.

Backport of r1176666 from trunk.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixes COUCHDB-1152 - Update ICU on Windows.
Robert Newson [Tue, 27 Sep 2011 23:11:24 +0000 (23:11 +0000)]
Fixes COUCHDB-1152 - Update ICU on Windows.

Thanks to Dave Cottlehuber for the patch.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMerge commit '34ba230324bb329ce5ed54d703dcb4d84a65ab86'
Robert Newson [Tue, 27 Sep 2011 11:33:24 +0000 (12:33 +0100)]
Merge commit '34ba230324bb329ce5ed54d703dcb4d84a65ab86'

8 years agoset cluster_ssl correctly, and tidy chttps section.
Robert Newson [Tue, 13 Sep 2011 04:14:58 +0000 (06:14 +0200)]
set cluster_ssl correctly, and tidy chttps section.

8 years agoadd https support.
benoitc [Tue, 13 Sep 2011 04:14:58 +0000 (06:14 +0200)]
add https support.

8 years agoWrite header before handing over compacted group
Adam Kocoloski [Fri, 23 Sep 2011 19:50:51 +0000 (19:50 +0000)]
Write header before handing over compacted group

Writing the header first ensures that the index will not be reset if
the server crashes in between the handoff and the next delayed_commit.


git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUpdated CouchJS to support SpiderMonkey 1.8.5
Paul J. Davis [Tue, 6 Sep 2011 20:27:10 +0000 (15:27 -0500)]
Updated CouchJS to support SpiderMonkey 1.8.5

This is tested against the 1.7.0, 1.8.0rc1, and 1.8.5 tarballs from
Mozilla's FTP directory. It's mostly the same code from trunk minus a
few tweaks to get it past a couple type errors using c++ instead of cc.

8 years agofix port conversion in vhost
Robert Newson [Thu, 22 Sep 2011 20:05:28 +0000 (20:05 +0000)]
fix port conversion in vhost

fix port conversion, don't forget to use substr function. spotted by
@rnewson on irc, again. thanks. patch by benoitc.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMake sure view compaction terminates
Filipe David Borba Manana [Thu, 15 Sep 2011 23:48:23 +0000 (23:48 +0000)]
Make sure view compaction terminates

If a view group is compacting and the corresponding database
is shutdown by the LRU system, then the view compaction is
aborted because its couch view group process shutdowns.
This could lead to situations where the number of active
databases is much higher than max_dbs_open and making it
impossible to compact view groups.

Issue reported and patch tested by Mike Leddy. Thanks.


This is a backport of revision 1171328 from branch 1.2.x

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoremove trailing comma
Jan Lehnardt [Thu, 15 Sep 2011 16:40:47 +0000 (16:40 +0000)]
remove trailing comma

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAllow slashes in doc ids in URLs to _update handlers.
Jan Lehnardt [Tue, 13 Sep 2011 18:54:31 +0000 (18:54 +0000)]
Allow slashes in doc ids in URLs to _update handlers.

This mirrors the behaviour of the _show API.

Patch by Christopher Bonhage.

Closes COUCHDB-1229

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMerge pull request #62 from benoitc/master
Adam Kocoloski [Mon, 12 Sep 2011 21:56:38 +0000 (14:56 -0700)]
Merge pull request #62 from benoitc/master

8 years agoAdd missing database 'created' event.
benoitc [Sat, 10 Sep 2011 09:19:20 +0000 (11:19 +0200)]
Add missing database 'created' event.

The `created` event is emitted on apache couchdb when a database is
created. This patch re-add it to bigcouch.

8 years agoInsane libtool hackery for windows (COUCHDB-1197)
Randall Leeds [Mon, 12 Sep 2011 20:54:32 +0000 (20:54 +0000)]
Insane libtool hackery for windows (COUCHDB-1197)

Patch by Dave Cottlehuber

Backport of r1169920

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoCOUCHDB-1274 - Use text/javascript content-type for jsonp responses.
Robert Newson [Thu, 8 Sep 2011 11:13:21 +0000 (11:13 +0000)]
COUCHDB-1274 - Use text/javascript content-type for jsonp responses.

Backported from trunk @1166618

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix list-style send() API in show functions when using provides()
Jan Lehnardt [Thu, 8 Sep 2011 11:03:20 +0000 (11:03 +0000)]
Fix list-style send() API in show functions when using provides()

Also fix ignoring the return value when the send() API isnused.

Patch by Alexander Shorin.

Closes COUCHDB-1272

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAnd the rest of the commit/
Paul Joseph Davis [Thu, 8 Sep 2011 05:05:19 +0000 (05:05 +0000)]
And the rest of the commit/

SVN != Git. Forgot to check svn status before committing.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix CouchJS compatibility with older SpiderMonkey.
Paul Joseph Davis [Thu, 8 Sep 2011 05:00:10 +0000 (05:00 +0000)]
Fix CouchJS compatibility with older SpiderMonkey.

This is a backport of the work to make CouchJS build against all of the
major versions of SpiderMonkey. Thanks to Randall Leeds and Chris
Coulson for the original patches.

Backport based on r1137464 and r1164346
Fixes COUCHDB-1078
Fixes COUCHDB-1260

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoadditional libtool lubrication for windows build
Randall Leeds [Wed, 7 Sep 2011 22:08:21 +0000 (22:08 +0000)]
additional libtool lubrication for windows build

This is related to COUCHDB-1197
Thanks Dave Cottlehuber for the patch

Backport of r1166438

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFixes COUCHDB-1265
Paul Joseph Davis [Fri, 2 Sep 2011 04:34:04 +0000 (04:34 +0000)]
Fixes COUCHDB-1265

Backport of 1164350 from trunk. Slightly modified for an export
declaration conflict and removing a clause that only applies to

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix order of parameters in log message
Filipe David Borba Manana [Wed, 31 Aug 2011 19:09:05 +0000 (19:09 +0000)]
Fix order of parameters in log message

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRemove unnecessary call after revision 1162306
Filipe David Borba Manana [Sat, 27 Aug 2011 07:40:54 +0000 (07:40 +0000)]
Remove unnecessary call after revision 1162306

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoFix replication crash on database compaction
Filipe David Borba Manana [Sat, 27 Aug 2011 07:30:35 +0000 (07:30 +0000)]
Fix replication crash on database compaction

There were race conditions that made replications crash
when a local endpoint database is compacted.
Patch tested by Joan Touzet.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoRemove Style where we have no need for it
Adam Kocoloski [Thu, 25 Aug 2011 19:07:33 +0000 (19:07 +0000)]
Remove Style where we have no need for it

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoDo not suppress old revisions from _changes
Adam Kocoloski [Thu, 25 Aug 2011 19:07:26 +0000 (19:07 +0000)]
Do not suppress old revisions from _changes

Requests to '_changes?style=all_docs' with a 'since' parameter would
suppress revisions of a document generated before the start of the
feed.  The assumption may have been that those revisions were seen by
the client in a previous request to _changes, but this is not
necessarily true if the client is resuming the feed after a partial

The safe thing to do is to include all leaf revisions for each document
in the feed.

Thanks Bob Dionne for the test code.

Closes COUCHDB-1256

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agobring windows in line with r1001283 (COUCHDB-1197)
Randall Leeds [Tue, 23 Aug 2011 19:19:22 +0000 (19:19 +0000)]
bring windows in line with r1001283 (COUCHDB-1197)

Thanks to Dave Cottlehuber for the patch.
This is a backport of r1160857 from trunk

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoUpdated changes feed connect timeout to 30 seconds
Filipe David Borba Manana [Fri, 19 Aug 2011 04:51:20 +0000 (04:51 +0000)]
Updated changes feed connect timeout to 30 seconds

This is the timeout used everywhere else. Some users are
constantly unable to replicate since under some scenarios
(namely via SSL) a timeout of 10 seconds is too short.

This is related to a thread in the users mailing list:

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdd missing assertions to test/etap/210-os-proc-pool.t
Filipe David Borba Manana [Thu, 18 Aug 2011 06:40:39 +0000 (06:40 +0000)]
Add missing assertions to test/etap/210-os-proc-pool.t

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoAdded executable bit to test/etap/210-os-proc-pool.t
Filipe David Borba Manana [Thu, 18 Aug 2011 05:51:31 +0000 (05:51 +0000)]
Added executable bit to test/etap/210-os-proc-pool.t

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMerge revision 1159045 from trunk
Filipe David Borba Manana [Thu, 18 Aug 2011 05:50:42 +0000 (05:50 +0000)]
Merge revision 1159045 from trunk

    Fix dead lock case in the os process pool

    Part of this patch was done by Paul Davis.
    The patch also introduces a test case to validate that
    the os process pool (couch_query_servers) operates as it
    Closes COUCHDB-1246.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoadd httpd/aborted_requests description.
Robert Newson [Wed, 17 Aug 2011 17:32:40 +0000 (18:32 +0100)]
add httpd/aborted_requests description.

8 years agoMerge branch '11554-merge-couchdb-1.1'
Adam Kocoloski [Mon, 15 Aug 2011 19:45:15 +0000 (15:45 -0400)]
Merge branch '11554-merge-couchdb-1.1'

8 years agoFix empty range check for raw collation.
Paul Joseph Davis [Mon, 15 Aug 2011 03:57:48 +0000 (03:57 +0000)]
Fix empty range check for raw collation.

The check for empty ranges was not taking into account the
view option for raw collation. This fixes that by passing
the couch_btree:less/2 function into the check.

Patch by: Jason Smith
Back port of: 1156506, 1156507, 1156509, 1156509, 1156610

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoMerge revision 1157428 from trunk
Filipe David Borba Manana [Sat, 13 Aug 2011 22:10:00 +0000 (22:10 +0000)]
Merge revision 1157428 from trunk

    Doc validation functions from deleted ddocs must be ignored

    If a design document is deleted by updating it with a "_deleted"
    field set to the boolean value true, its validate_doc_update function
    should be ignored for subsequent document insertions/updates.

    This closes COUCHDB-1227.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoReset tracking branches to master
Adam Kocoloski [Sat, 13 Aug 2011 01:53:57 +0000 (21:53 -0400)]
Reset tracking branches to master

8 years agoassert that calls to file functions actually succeed.
Robert Newson [Mon, 25 Jul 2011 21:25:40 +0000 (21:25 +0000)]
assert that calls to file functions actually succeed.

1) couch_file:sync could leave open fd's if close failed. Now we'll get a trace.
2) couch_file:append_term failing would be bad, so let's test that too.

backported from trunk r1150915

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

8 years agoinclude new share/www files missed in the 1.1 merge.
Robert Newson [Sat, 23 Jul 2011 12:09:02 +0000 (13:09 +0100)]
include new share/www files missed in the 1.1 merge.

8 years agoallow replication callback module to be chosen at runtime.
Robert Newson [Thu, 14 Jul 2011 10:25:58 +0000 (11:25 +0100)]
allow replication callback module to be chosen at runtime.

8 years agomove couch_js_functions.hrl to include dir
Robert Newson [Wed, 13 Jul 2011 15:02:39 +0000 (16:02 +0100)]
move couch_js_functions.hrl to include dir

8 years agoAllow asynchronous view group updates.
Robert Newson [Fri, 12 Aug 2011 12:37:46 +0000 (13:37 +0100)]
Allow asynchronous view group updates.

9 years agoRevert couch_server changes added in revision 1156361
Filipe David Borba Manana [Wed, 10 Aug 2011 22:01:33 +0000 (22:01 +0000)]
Revert couch_server changes added in revision 1156361

Leaving the tests however since it doesn't hurt.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoCOUCHDB-1245 - enforce maximum chunk size for _log call to better manage memory.
Robert Newson [Wed, 10 Aug 2011 21:06:50 +0000 (21:06 +0000)]
COUCHDB-1245 - enforce maximum chunk size for _log call to better manage memory.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoMerged revision 1156360 from trunk
Filipe David Borba Manana [Wed, 10 Aug 2011 20:47:27 +0000 (20:47 +0000)]
Merged revision 1156360 from trunk

    Prevent data loss on db creation request

    1) Create and populate a database
    2) Restart the server
    3) Send a PUT request to create the database - the server
       will override the existing file, making all previous
       documents no longer accessible nor recoverable

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoCOUCHDB-1244 - close file descriptor in couch_log:read/2
Robert Newson [Wed, 10 Aug 2011 20:23:52 +0000 (20:23 +0000)]
COUCHDB-1244 - close file descriptor in couch_log:read/2

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoadd note that R14B01 or higher is needed to build a release.
Robert Newson [Wed, 3 Aug 2011 12:24:01 +0000 (13:24 +0100)]
add note that R14B01 or higher is needed to build a release.

9 years agoBackport of r1152399 from trunk
Randall Leeds [Sat, 30 Jul 2011 00:37:37 +0000 (00:37 +0000)]
Backport of r1152399 from trunk

add an etap test for btree traversal callbacks

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoBackport of r1152398 from trunk
Randall Leeds [Sat, 30 Jul 2011 00:37:32 +0000 (00:37 +0000)]
Backport of r1152398 from trunk

Fix COUCHDB-1076 - views skip empty btree branches

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoBackport of r1152397 from trunk
Randall Leeds [Sat, 30 Jul 2011 00:37:28 +0000 (00:37 +0000)]
Backport of r1152397 from trunk

Call traversal handlers in btree folds

Previously the fold function was only invoked for leafs.
With this change it's possible to define a fold function which is called
for inner nodes and can return a tuple {skip, Acc} in order to skip
exploration of the branch.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agorevert redundant pattern match.
Robert Newson [Thu, 28 Jul 2011 19:14:08 +0000 (19:14 +0000)]
revert redundant pattern match.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoassert that calls to file functions actually succeed.
Robert Newson [Mon, 25 Jul 2011 21:25:40 +0000 (21:25 +0000)]
assert that calls to file functions actually succeed.

1) couch_file:sync could leave open fd's if close failed. Now we'll get a trace.
2) couch_file:append_term failing would be bad, so let's test that too.

backported from trunk r1150915

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoMerge revision 1143375 from trunk
Filipe David Borba Manana [Wed, 6 Jul 2011 12:27:15 +0000 (12:27 +0000)]
Merge revision 1143375 from trunk

    Redefine logging macros

    With these macro definitions we don't evaluate the arguments
    if the corresponding log level is not enabled.
    This behaviour was accidently removed by the patch from

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoRemove warning about unused variable
Filipe David Borba Manana [Sun, 3 Jul 2011 09:58:54 +0000 (09:58 +0000)]
Remove warning about unused variable

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoMerged revision 1142262 from trunk
Filipe David Borba Manana [Sat, 2 Jul 2011 18:52:14 +0000 (18:52 +0000)]
Merged revision 1142262 from trunk

    On server startup, restart replications in error

    If we setup a continuous replication which goes into
    an error state and restart Couch just before the
    replication is retried (before it transitions to the
    triggered state), the user has to manually restart
    the replication (recreating the document or deleting
    its _replication_state field).

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoMerge revision 1142259 from trunk
Filipe David Borba Manana [Sat, 2 Jul 2011 18:47:54 +0000 (18:47 +0000)]
Merge revision 1142259 from trunk

    Replication manager, ignore db monitor messages

    Ignore local database monitor messages. These messages
    are received in some circunstances because replication
    processes spawn local database monitors but never
    do the corresponding erlang:demonitor/1,2 calls.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68

9 years agoRestart replications on error
Filipe David Borba Manana [Sat, 2 Jul 2011 18:44:00 +0000 (18:44 +0000)]
Restart replications on error

If a replication transitions to the "error" state, attempt
to restart it up to "max_replication_retry_count" times
(.ini configuration parameter). This number of retry attempts
can now be set to "infinity" as well.

This was already current behaviour in trunk (upcoming 1.2).

Closes COUCHDB-1194.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68



9 years agoBackport revision 1140886 from trunk
Filipe David Borba Manana [Tue, 28 Jun 2011 23:01:30 +0000 (23:01 +0000)]
Backport revision 1140886 from trunk

    Improved error message in the replicator

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68