summaryrefslogtreecommitdiff
path: root/rel
Commit message (Collapse)AuthorAgeFilesLines
* Decrease the view indexer transaction timedecrease-indexer-transaction-time-limitNick Vatamaniuc2021-03-221-7/+23
| | | | | | | | | | | | | | The indexer transaction time is decreased in order to allow enough time for the client to re-use the same GRV to emit doc bodies. This PR goes along with [1], where emitted doc bodies in a view responses now come from the same database read version as the one used by the indexer. Since the batcher previously used 4.5 seconds as the maximum, that left little time to read any doc bodies. [1]: https://github.com/apache/couchdb/pull/3391 Issue: https://github.com/apache/couchdb/issues/3381
* Lower the view indexer transaction retry limitNick Vatamaniuc2021-03-041-0/+13
| | | | | | | | Previously, the view indexer used the default retry limit (100) from the `fdb_tx_options` config section. However, since the batching algorithm relies on sensing errors and reacting to them, retrying the batch 100 times before erroring out was not optimal. So value is lowered down to 5 and it's also made configurable.
* Add a development container for VS Code (#3343)Adam Kocoloski2021-01-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a development container config for VS Code This creates a development environment with a FoundationDB server and a CouchDB layer in two containers, sharing a network through Docker Compose. It uses the FDB image published to Docker Hub for the FDB container, and downloads the FDB client packages from foundationdb.org to provide the development headers and libraries. www.foundationdb.org is actually not trusted in Debian Buster by default, so we have to download the GeoTrust_Global_CA.pem. The following link has more details: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=962596 Once the Docker Compose setup is running, VS Code executes the create_cluster_file.bash script to write down a cluster file containing the IP address in the compose network where the FDB service can be found. This cluster file is used both for a user-driven invocation of `./dev/run`, as well as for unit tests that require a running CouchDB. Additionally, I've got a small fix to the way we run explicitly specified eunit tests: * Run eunit tests for each app separately The `eunit` target executes a for loop that appears intended to use a separate invocation of rebar for each Erlang application's unit tests. When running `make eunit` without any arguments this works correctly, as the for loop processes the output of `ls src`. But if you specify a comma-delimited list of applications the for loop will treat that as a single argument and pass it down to rebar. This asymmetry is surprising, but also seems to cause some issues with environment variables not being inherited by the environment used to execute the tests for the 2..N applications in the list. I didn't bother digging into the rebar source code to figure out what was happening there. This patch just parses the incoming comma-delimited list with `sed` to create a whitespace-delimited list for the loop, so we get the same behavior regardless of whether we are specifying applications explicitly or not.
* Allow for disabling custom reduce functionsPaul J. Davis2020-10-201-0/+3
| | | | | | | This changes allows administators to disable custom JavaScript reduce functions. Custom reduce functions are notoriously difficult to write correctly and most of the time when written correctly would be more efficiently done using an builtin reduce.
* add missing applications to reltool.configRobert Newson2020-10-161-0/+12
|
* simplify max_document_size commentRobert Newson2020-10-061-4/+2
|
* Views on ebtreePaul J. Davis2020-09-301-0/+6
|
* Merge branch master into prototype/fdb-layerPaul J. Davis2020-09-164-11/+47
|\
| * Add option to delay responses until the enddelay_response_until_endRobert Newson2020-09-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | When set, every response is sent once fully generated on the server side. This increases memory usage on the nodes but simplifies error handling for the client as it eliminates the possibility that the response will be deliberately terminated midway through due to a timeout. The config value can be changed at runtime without impacting any in-flight responses.
| * Windows: provide full path to epmdJoan Touzet2020-08-031-0/+1
| |
| * feat(auth): Allow a custom JWT claim for rolesmauroporras2020-06-041-0/+1
| |
| * allow configurability of JWT claims that require a valueRobert Newson2020-05-181-1/+3
| | | | | | | | | | | | | | e.g; [jwt] required_claims = {iss, "https://example.com/issuer"}
| * Drop os_mon from dependenciesJoan Touzet2020-04-281-2/+0
| |
| * Replace VM_ARGS with ARGS_FILE which is set as it is in couchdb script ↵Simon Klassen2020-04-221-5/+16
| | | | | | | | | | | | /etc/vm.args; also parses name from config. (#2738) Co-authored-by: sklassen <none> Co-authored-by: Joan Touzet <wohali@users.noreply.github.com>
| * Verify all presented claimsjwt-controls-2Robert Newson2020-03-301-1/+1
| | | | | | | | | | | | All claims in the header and payload are verified if present. The required_claims config setting is now separate and only causes CouchDB to reject JWT tokens without those claims.
| * Remove enhanced alg checkRobert Newson2020-03-301-2/+0
| | | | | | | | | | This mechanism is replaced by the much stronger tying of verification algorithm to the key directly in the server config.
| * Only trust the servers declaration of JWT key typeRobert Newson2020-03-281-4/+5
| |
| * Ensure clean PATH for Windows couchdb.cmd (#2708)Joan Touzet2020-03-231-1/+1
| |
| * support RSA for JWT authRobert Newson2020-03-221-2/+14
| |
| * Feature - Add JWT support (#2648)Alexander Trauzzi2020-03-191-0/+10
| | | | | | | | | | | | Add JWT Authentication Handler Co-authored-by: Robert Newson <rnewson@apache.org> Co-authored-by: Joan Touzet <wohali@users.noreply.github.com>
| * add jwtf to releaseimport-jwtfRobert Newson2020-03-121-0/+2
| |
| * move "users_db_security_editable" to the correct locationDan Barbarito2020-03-081-3/+3
| |
* | Update and cleanup default.ini replicator entriesNick Vatamaniuc2020-09-151-19/+59
| | | | | | | | | | Update settings with defaults. Also comment out values which are already set to default in the code.
* | Add after_db_create/2 and after_db_delete/2 callbacks to fabricNick Vatamaniuc2020-09-151-0/+1
| | | | | | | | | | | | `after_db_create/2` and `after_db_delete/2` are when databases are created and deleted respectively. The callbacks are called with both the database name and the database instance UUID values.
* | Optimize view indexer batch sizesPaul J. Davis2020-09-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The couch_views_batch module is responsible for sensing the largest batch sizes that can be successfully processed for a given indexer process. It works by initially searching for the maximum number of documents that can be included in a batch. Once this threshold is found it then works by slowly increasing the batch size and decreasing when its found again. This approach works to maximise batch sizes while being reactive to when a larger batch would cross over the FoundationDB transaction limits which causes the entire batch to be aborted and retried which wastes time during view builds.
* | Remove couch_ratePaul J. Davis2020-09-152-8/+0
| | | | | | | | | | | | This implementation was difficult to understand and had behavior that was too difficult to predict. It would break if view behavior changed in significant ways from what was originally expected.
* | Add option to delay responses until the endRobert Newson2020-09-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | When set, every response is sent once fully generated on the server side. This increases memory usage on the nodes but simplifies error handling for the client as it eliminates the possibility that the response will be deliberately terminated midway through due to a timeout. The config value can be changed at runtime without impacting any in-flight responses.
* | add ebtree to rebar / reltool.configRobert Newson2020-07-211-0/+2
| |
* | Add max_bulk_get_count configuration optionILYA Khlopotov2020-06-221-0/+4
| |
* | Split couch_views acceptors and workersNick Vatamaniuc2020-06-081-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize couch_views by using a separate set of acceptors and workers. Previously, all `max_workers` where spawned on startup, and were to waiting to accept jobs in parallel. In a setup with a large number of pods, and 100 workers per pod, that could lead to a lot of conflicts being generated when all those workers race to accept the same job at the same time. The improvement is to spawn only a limited number of acceptors (5, by default), then, spawn more after some of them become workers. Also, when some workers finish or die with an error, check if more acceptors could be spawned. As an example, here is what might happen with `max_acceptors = 5` and `max_workers = 100` (`A` and `W` are the current counts of acceptors and workers, respectively): 1. Starting out: `A = 5, W = 0` 2. After 2 acceptors start running: `A = 3, W = 2` Then immediately 2 more acceptors are spawned: `A = 5, W = 2` 3. After 95 workers are started: `A = 5, W = 95` 4. Now if 3 acceptors accept, it would look like: `A = 2, W = 98` But no more acceptors would be started. 5. If the last 2 acceptors also accept jobs: `A = 0, W = 100` At this point no more indexing jobs can be accepted and started until at least one of the workers finish and exit. 6. If 1 worker exits: `A = 0, W = 99` An acceptor will be immediately spawned `A = 1, W = 99` 7. If all 99 workers exit, it will go back to: `A = 5, W = 0`
* | Introduce _bulk_docs max_doc_count limitNick Vatamaniuc2020-05-271-0/+4
| | | | | | | | | | | | | | Let users specify the maximum document count for the _bulk_docs requests. If the document count exceeds the maximum it would return a 413 HTTP error. This would also signal the replicator to try to bisect the _bulk_docs array into smaller batches.
* | Lower the default batch size for update_docs to 2.5MBNick Vatamaniuc2020-05-271-1/+1
| | | | | | | | Observed a number of timeouts with the previous default
* | Bulk docs transaction batchingNick Vatamaniuc2020-05-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Interactive (regular) requests are split into smaller transactions, so larger updates won't fail with either timeout so or transaction too large FDB errors. * Non-interactive (replicated) requests can now batch their updates in a few transaction and gain extra performance. Batch size is configurable: ``` [fabric] update_docs_batch_size = 5000000 ```
* | Convert aegis key cach to LRU with hard expiration timeEric Avdey2020-05-071-0/+13
| |
* | Allow specifying FDB transaction optionsNick Vatamaniuc2020-04-271-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the latest erlfdb release v1.1.0 we have the ability to set default transaction options on the database handle. Once set, those are inherited by every transaction started from that handle. Use this feature to give advanced users a way to experiment with various transaction options. Descriptions of those options in the default.ini file have been mostly a copy and paste from the fdb_c_option.g.h file from the client library. In addition, specify some safer default values for transaction timeouts (1min) and retry limit (100). These quite conservative and are basically something less that "infinity". In the future these may be adjusted lower.
* | Add native encryption supportRobert Newson2020-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new application, aegis, is introduced to provide strong at-rest protection of CouchDB data (where possible). Currently we encrypt the following values (if enabled): 1. Document content 2. Attachment content 3. Index values Things not encrypted: 1. _all_docs 2. _changes 3. doc id 4. doc rev 5. Index keys 6. All other metadata Co-Authored-By: Eric Avdey <eiri@apache.org> Co-Authored-By: Robert Samuel Newson <rnewson@apache.org>
* | Enable configurable binary chunk sizeJay Doane2020-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Currently, the size of binary chunks used for values is fixed at the FDB imposed limit of 100kB, although they recommend using 10KB [1], (also note they subtly change units). This makes that value configurable, allowing e.g. benchmarks to compare performance of runs with varying chunk size. The cost is a ~10µs config lookup penalty each time data needs to be chunked. [1] https://www.foundationdb.org/files/record-layer-paper.pdf
* | Optionally cleanup stale indices automaticallyPaul J. Davis2020-04-101-0/+3
| |
* | Fix index updater configuration keysPaul J. Davis2020-04-101-3/+3
| | | | | | | | | | The defaults commented out in `default.ini` did not match the names used in `fabric2_index.erl`.
* | Add mango indexingGarren Smith2020-04-061-0/+1
| | | | | | | | | | | | This uses couch_views_updater to create mango indexes in the doc update along with the couch_views_indexer to update the indexes in the background up to the creation versionstamp.
* | Add couch_views_updater interactive indexerGarren Smith2020-04-061-0/+1
| | | | | | | | | | | | This adds the ability for couch_views to index an index in the docs update transaction. This only happens if a design doc has the field <<"interactive">> = true.
* | Use `couch_rate` application for `couch_view`ILYA Khlopotov2020-04-022-0/+7
| |
* | Implement a simple index auto-updaterNick Vatamaniuc2020-03-092-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main logic is as follows: - After doc update transaction(s) are completed in the `fabric2_db` module, call the `fabric2_index:db_updated(Db)` function. - `fabric2_index:db_updated(Db)` inserts a `{DbName, Timestamp}` tuple into one of the sharded ets tables. The tuple is inserted using `ets:insert_new`, which ensures only the first entry succeeds and others will be ignored, until that entry is cleared. - Each ets table in `fabric2_index` has a simple monitor process that periodically scans that table. If it finds databases which have been updated, it notifies all the indices which have registered with `fabric2_index` to build indices. There are config settings to disable index auto-updating and to adjust the delay interval, and the resolution. The interval specifies how long to wait since the first time the db was modified. The resolution interval specifies how often to check the ets tables. Just like in the original ken, design documents can have an `"autoupdate": false` option to disable auto-updating that design document only.
* | Add Key/Value size limit for map indexesGarren Smith2020-03-041-0/+4
| |
* | Support jaeger http reporterILYA Khlopotov2020-03-021-3/+9
| |
* | Add ctrace applicationILYA Khlopotov2020-03-021-8/+42
| |
* | Implement couch_js callbacks for couch_evalPaul J. Davis2020-03-021-0/+6
| |
* | Initial creation of couch_js applicationPaul J. Davis2020-03-021-0/+2
| | | | | | | | | | | | | | | | | | This commit is mostly a copy paste of the existing modules in the `couch` application. For now I've left the build of the `couchjs` executable in `couch/priv` to avoid having to do the work of moving the build config over. I had contemplated just referencing the modules as they current exist but decided this would prepare us a bit better for when we eventually remove the old modules.
* | Add couch_eval abstraction layerGarren Smith2020-03-021-0/+2
| |
* | Add a max db name length config optionNick Vatamaniuc2020-03-021-0/+7
| | | | | | | | | | | | | | This is done for compatibility with CouchDB < 4.x where this limit was implicitly enforced by the file system's max filename size. The default value enforces the same limit for FDB in case users decide to replicate back and forth between old and new instances with 'create_target = true' option.