summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_server.erl
AgeCommit message (Collapse)Author
2011-08-10Revert couch_server changes added in revision 1156361Filipe David Borba Manana
Leaving the tests however since it doesn't hurt. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1156385 13f79535-47bb-0310-9956-ffa450edef68
2011-08-10Merged revision 1156360 from trunkFilipe David Borba Manana
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: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1156361 13f79535-47bb-0310-9956-ffa450edef68
2010-10-27sort _all_dbs at api not http level.Robert Newson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1028070 13f79535-47bb-0310-9956-ffa450edef68
2010-09-30Removing ?getv macros.Filipe David Borba Manana
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities. (Only allowed in R13B04 and R14). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
2010-09-27Replacing calls to couch_util:get_value with ?getvFilipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001879 13f79535-47bb-0310-9956-ffa450edef68
2010-08-04Add replicator DB (_replicator).Filipe David Borba Manana
Part of ticket COUCHDB-776. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@982330 13f79535-47bb-0310-9956-ffa450edef68
2010-08-04Don't close an idle system DB to open a non-system DB. Doing so allowed us ↵Filipe David Borba Manana
to open more than max_open_dbs non-system DBs. This issue is revealed when there are more than 1 system DBs (_users and _replicator). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@982328 13f79535-47bb-0310-9956-ffa450edef68
2010-07-11deleting a DB while it was being opened would crash couch_serverAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@962964 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03Fix deletion to move properly to root of storage, to avoid copying files ↵Damien F. Katz
when view and database dirs are on different mounts. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@960153 13f79535-47bb-0310-9956-ffa450edef68
2010-07-03Fixed intermittent problem deleting files on Windows. Added Juhani ↵Damien F. Katz
Ränkimies to THANKS git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@960150 13f79535-47bb-0310-9956-ffa450edef68
2010-07-02Moving duplicated code into a single private module function.Filipe David Borba Manana
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@959946 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30Bug fix when creating a DB with the option 'sys_db' and the number of ↵Filipe David Borba Manana
current opened DBs corresponds to the max_open_dbs config parameter. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@959246 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23Authentication caching, to avoid repeated opening and closing of the users ↵Damien F. Katz
database for each request requiring authentication. COUCHDB-807 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957314 13f79535-47bb-0310-9956-ffa450edef68
2010-06-23Make file deletions async to avoid pauses during compaction and db deletion. ↵Damien F. Katz
Fixes COUCHDB-780. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957303 13f79535-47bb-0310-9956-ffa450edef68
2010-06-02trailing whitespace pedantryJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@950545 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04use keysearch BIF to search ejson props. Closes COUCHDB-747Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@940708 13f79535-47bb-0310-9956-ffa450edef68
2010-04-02change couch_server calls to have infinity timeout, because it might have to ↵Damien F. Katz
wait for disk io. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@930365 13f79535-47bb-0310-9956-ffa450edef68
2010-04-02Deterministic/synchronous shutdown code.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@930363 13f79535-47bb-0310-9956-ffa450edef68
2010-03-16Fixes couch_server:all_databases/0Paul Joseph Davis
The logic was failing when the database path had a '.' path component in the middle because Filename -- Root is not a prefix operation. This patch adds a normalization function to couch_util that is run on the Root and Filename variables before doing the array subtraction. I could probably make it smarter and error out but I got lazy. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@923526 13f79535-47bb-0310-9956-ffa450edef68
2010-03-15Made the opening of databases asynchronous, so that requests to open ↵Damien F. Katz
databases that are already in the open database cache do not have to wait on the file system. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@923456 13f79535-47bb-0310-9956-ffa450edef68
2010-03-04reverting damien's latest commit until we can figure out why it's causing ↵John Christopher Anderson
failures git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@918834 13f79535-47bb-0310-9956-ffa450edef68
2010-03-04Changed process tree shutdown to be synchronous, to eliminate spurious test ↵Damien F. Katz
failures caused by processes not shutdown fast enough or at the wrong time. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@918805 13f79535-47bb-0310-9956-ffa450edef68
2010-01-09make the default account db called _users, not usersJohn Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@897531 13f79535-47bb-0310-9956-ffa450edef68
2009-09-13allow config callbacks to get passed the X-Couch-Persist flagJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@814300 13f79535-47bb-0310-9956-ffa450edef68
2009-09-09choice of uuid algos for better insert perf. Closes COUCHDB-465. Thanks ↵Adam Kocoloski
rnewson, bitdiddle git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@813051 13f79535-47bb-0310-9956-ffa450edef68
2009-09-02skip some regex etc. if DB is already openAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@810729 13f79535-47bb-0310-9956-ffa450edef68
2009-08-30refactor CouchDB startup procedure, see COUCHDB-216 for detailsAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@809392 13f79535-47bb-0310-9956-ffa450edef68
2009-08-15replace regexp with re. Thanks Kim Shrier, Gordon Stratton. Closes COUCHDB-245Adam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@804428 13f79535-47bb-0310-9956-ffa450edef68
2009-07-23use spawn to avoid recursive gen_server callsAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@797092 13f79535-47bb-0310-9956-ffa450edef68
2009-07-23Fixes error on first boot after adding an admin.Paul Joseph Davis
hash_admin_passwords() was being called after registering a config callback which caused couch_server to die when first booting. Just placed the first call before registering the callback. Thanks Bob Dionne. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@797055 13f79535-47bb-0310-9956-ffa450edef68
2009-07-14wheeeeeeeeNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@794057 13f79535-47bb-0310-9956-ffa450edef68
2009-07-06trimmed trailing whitespaceNoah Slater
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791350 13f79535-47bb-0310-9956-ffa450edef68
2009-05-18remove leftover .compact files on DB deleteAdam Kocoloski
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775785 13f79535-47bb-0310-9956-ffa450edef68
2009-05-06First cut at _changes api. Update the by_id and by_seq indexes to contain ↵Damien F. Katz
update seq numbers and pointers to bodies on disk, for use in the _changes api. This is a new file version, but the code can continue to serve the old 0.9 version without problems, though certain features in the _changes api will not be able to work. Upgrade to new file version (from 1 to 2) by compacting the file. Also fixed bugs with how the stats api tracks open databases. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@772406 13f79535-47bb-0310-9956-ffa450edef68
2009-04-10Fixes for leaked file handles, with test.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@763858 13f79535-47bb-0310-9956-ffa450edef68
2009-02-25add js test suite for stats, enable access for a previously internal metricJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@747852 13f79535-47bb-0310-9956-ffa450edef68
2009-02-22Add runtime statistics -- without EUnit tests for now.Jan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@746691 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17Put file ref_counting into it's own module, to make the speed of opening an ↵Damien F. Katz
already open database faster (by not waiting on file pending operations, particularly fsync). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@745076 13f79535-47bb-0310-9956-ffa450edef68
2009-01-19tests for fix to COUCHDB-215, and changing of how max_dbs_open setting is ↵Damien F. Katz
handled at runtime. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735875 13f79535-47bb-0310-9956-ffa450edef68
2009-01-19Fix for COUCHDB-215, we weren't properly converting a config setting to an ↵Damien F. Katz
integer. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735817 13f79535-47bb-0310-9956-ffa450edef68
2008-12-22Fix for leaked file handles when not explicitly closed, added file stats ↵Damien F. Katz
code for checking for leaked file handles, and some refactoring of the view api. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@728764 13f79535-47bb-0310-9956-ffa450edef68
2008-12-18fix for crash of couch_server when database non-existantDamien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@727832 13f79535-47bb-0310-9956-ffa450edef68
2008-12-18Fixed problem when a crashed db can cause couch_server to crash when it ↵Damien F. Katz
attempts to interact with it. Moved the interaction from couch_server into the caller's process. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@727811 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10view group state gen_server. thanks damien and davisp.John Christopher Anderson
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@724946 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20Nearly completed security/validation work. Still needs replication testing.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@719160 13f79535-47bb-0310-9956-ffa450edef68
2008-11-17More security and validation work. Still incomplete.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@718311 13f79535-47bb-0310-9956-ffa450edef68
2008-11-11Check in of initial validation and authorization work. This work is ↵Damien F. Katz
incomplete, as there is not yet any way of restricting who can update the design docs. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@713132 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22Send a notification when a database is createdJan Lehnardt
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@707076 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22First check-in of admin http authentication and authorization.Damien F. Katz
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@706848 13f79535-47bb-0310-9956-ffa450edef68
2008-10-02HTTPd refactoring. Moved most code out of couch_httpd into associated ↵Damien F. Katz
modules (couch_httpd_view, couch_httpd_db, couch_httpd_misc_handlers). Also a fix to removed previous doc_by_seq index entries on compaction retry. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@701173 13f79535-47bb-0310-9956-ffa450edef68