summaryrefslogtreecommitdiff
path: root/apps/couch
AgeCommit message (Collapse)Author
2012-04-24WhitespaceBob Dionne
2012-03-20Invoke couch_view_updater with the proper argumentsAdam Kocoloski
This fixes stale=update_after.
2012-02-22Merge 0.4.xRobert Newson
2012-01-31Fix previous commitRobert Newson
2012-01-31Fix bug in replicator request pipliningPaul J. Davis
A replication with both an HTTP source and target on the same host and port could end up in a dead lock due to ibrowse replication pipelining when attachments are present on the source. The ibrowse http worker would end up forming a multipart/mime body using anonymous reader functions for attachment stubs. When the attachment stub functions are executed it is possible that they end up assigned to the same ibrowse worker. This is a bit of a long path but then end result is equivalent to calling gen_server:call(self(), Args, infinity) from a gen_server callback. A quick work around for users is to set up a DNA alias (possibly in /etc/hosts) or to use a combination of hostname and ip address so that ibrowse assigns the requests to different pools.
2012-01-27WhitespaceBob Dionne
2012-01-24Minor bug getting the reduce_limit settingPaul J. Davis
2012-01-24Minor bug getting the reduce_limit settingPaul J. Davis
2012-01-18Revert use of spawn_monitorRobert Newson
As Filipe correctly points out, we want the parent to die if the child dies.
2012-01-16Only set the process dictionary if exit was okRobert Newson
2012-01-16Use spawn_monitor to await process completionRobert Newson
BugzID: 13133
2011-12-02whitespaceBob Dionne
2011-11-22Remove unused importsBob Dionne
2011-11-09Conditionally apply JSON encoding to update_seq valuesRobert Newson
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
2011-11-09Conditionally apply JSON encoding to update_seq valuesRobert Newson
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
2011-10-31Merge commit '1.1.1' into 0.4.xRobert Newson
Conflicts: acinclude.m4.in configure.ac couchjs/c_src/http.c src/erlang-oauth/Makefile.am src/erlang-oauth/oauth.app.in src/erlang-oauth/oauth_hmac_sha1.erl src/erlang-oauth/oauth_http.erl src/erlang-oauth/oauth_plaintext.erl src/etap/etap_web.erl
2011-10-31Fix retrieval of headers larger than 4kAdam Kocoloski
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.
2011-10-31Fix retrieval of headers larger than 4kAdam Kocoloski
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.
2011-10-18Merge pull request #76 from cloudant/12741-replication-seq-formatAdam Kocoloski
2011-10-17Fix seq problem in full_uri by encodingBob Dionne
BugzID:12741
2011-10-13Fix badarg error in couch_server:try_close_lru/1Paul J. Davis
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.
2011-10-10Merge remote-tracking branch 'apache/1.1.x'Robert Newson
2011-10-04Merge remote branch 'apache/1.1.x'Adam Kocoloski
2011-09-29restore update_group for better update_after implementation.Robert Newson
2011-09-28Merge 1.1.x because Paul Davis kept his important bug fix super secret while ↵Robert Newson
I was slaving away on this merge for two days.
2011-09-28remove bad new tests. evil tests, I keel you.Robert Newson
2011-09-28Merge 1.1.x changesRobert Newson
Conflicts: apps/couch/include/couch_db.hrl apps/couch/src/couch_db.erl apps/couch/src/couch_os_process.erl apps/couch/src/couch_query_servers.erl apps/couch/src/couch_rep.erl apps/couch/src/couch_replication_manager.erl apps/couch/src/couch_view_compactor.erl apps/couch/src/couch_view_group.erl apps/couch/src/couch_view_updater.erl configure.ac couchjs/c_src/http.c couchjs/c_src/main.c couchjs/c_src/utf8.c etc/windows/couchdb.iss.tpl src/couchdb/priv/Makefile.am src/couchdb/priv/couch_js/main.c test/etap/160-vhosts.t test/etap/200-view-group-no-db-leaks.t test/etap/Makefile.am BugzID: 12645
2011-09-12Add missing database 'created' event.benoitc
The `created` event is emitted on apache couchdb when a database is created. This patch re-add it to bigcouch.
2011-08-17add httpd/aborted_requests description.Robert Newson
2011-08-15Merge branch '11554-merge-couchdb-1.1'Adam Kocoloski
2011-08-12assert that calls to file functions actually succeed.Robert Newson
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: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1150918 13f79535-47bb-0310-9956-ffa450edef68
2011-08-12allow replication callback module to be chosen at runtime.Robert Newson
2011-08-12move couch_js_functions.hrl to include dirRobert Newson
2011-08-12Allow asynchronous view group updates.Robert Newson
2011-07-05Remove warning about unused variableFilipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1142410 13f79535-47bb-0310-9956-ffa450edef68
2011-07-05Merged revision 1142262 from trunkFilipe David Borba Manana
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: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1142263 13f79535-47bb-0310-9956-ffa450edef68
2011-07-05Merge revision 1142259 from trunkFilipe David Borba Manana
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: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1142260 13f79535-47bb-0310-9956-ffa450edef68
2011-07-05Restart replications on errorFilipe David Borba Manana
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: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1142258 13f79535-47bb-0310-9956-ffa450edef68 Conflicts: apps/couch/src/couch_rep.erl
2011-07-05Backport revision 1140886 from trunkFilipe David Borba Manana
Improved error message in the replicator git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1140887 13f79535-47bb-0310-9956-ffa450edef68
2011-07-05Merged revision 1104168 from trunkFilipe David Borba Manana
Add infinity timeout to couch_ref_counter calls After compacting a very large database, the updater calls the couch_db gen_server with a db record that contains a new ref counter. The couch_db gen_server calls drop on the old ref counter and calls add on the new ref counter. However since the system is busy deleting the old db file or garbage collecting, one of the ref counter calls times out, causing couch_db's terminate to invoked and terminate calls shutdown on the updater. However the updater is waiting for the call it made to couch_db to complete, which can't complete since it's waiting for the updater. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1138799 13f79535-47bb-0310-9956-ffa450edef68
2011-06-29Guard against dead fd process in is_idle/1Adam Kocoloski
BugzID: 12365
2011-06-22Merge remote-tracking branch 'upstream/1.1.x' into 0.4.xRobert Newson
Conflicts: acinclude.m4.in apps/couch/src/couch_app.erl apps/couch/src/couch_doc.erl apps/couch/src/couch_view.erl configure.ac share/www/script/test/replicator_db.js src/erlang-oauth/Makefile.am test/etap/Makefile.am
2011-06-16support _design and _doc_ids filters.Robert Newson
2011-06-13Merge CouchDB 1.1Robert Newson
2011-05-19Removed duplicate code, thanks davisp.Robert Dionne
2011-05-19Fix under-reported values in reduce viewsAdam Kocoloski
Thanks Hardtke for ruining my afternoon^H^H^H^H demonstrating the bug. BugzID: 12112
2011-05-05Allow : in passwords (COUCHDB-969)Robert Newson
2011-04-19Track and report size of live data in DBs and viewsRobert Dionne
The #full_doc_info record is extended to include the summed size of leaf revision document bodies and their attachments. Document sizes are computed on update; accurate sizes of existing databases and view groups are only available after compaction. The document size is defined to be the size of the binary representation of #doc.body. The att_len field is used for attachments; attachments that are shared by multiple revisions of a document are only counted once. The size of a view index is defined as the size of all keys, values, and reductions accessible from the current root of the tree. BugzID: 9995
2011-04-19BugzID:9995 Add a tree foldl function to couch_key_tree.Robert Dionne
This function can be used by many of the existing functions in couch_key_tree that need to walk the revision tree, apply a function at each branch or leaf, and then accumulate results.
2011-04-18Monitor Fd after creating DBRobert Dionne
This patch has the side effect of fixing a crash of the _users DB after the first minute of running. The crash occurs because BigCouch presumes that couch_stats_collector is monitoring the file descriptor, but nothing prevents the supervisor from starting couch_auth_cache (and thus opening the _users DB) before couch_stats_collector is started. The start order is determined by the ordering of the children from the config file in couch_config's ets set. Closes #39 BugzID: 11854