summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Relax isolation level when indexer reads from DBsnapshots-reads-for-indexingAdam Kocoloski2021-03-011-6/+8
| | | | | | | | | | | | | | | | | | | This patch causes the indexing subsystem to use snapshot isolation when reading from the database. This reduces commit conflicts and ensures the index can make progress even in the case of frequently updated docs. In the pathological case, a document updated in a fast loop can cause the indexer to stall out entirely when using serializable reads. Each successful update of the doc will cause the indexer to fail to commit. The indexer will retry with a new GRV but the same target DbSeq. In the meantime, our frequently updated document will have advanced beyond DbSeq and so the indexer will finish without indexing it in that pass. This process can be repeated ad infinitum and the document will never actually show up in a view response. Snapshot reads are safe for this use case precisely because we do have the _changes feed, and we can always be assured that a concurrent doc update will show up again later in the feed.
* Merge pull request #3386 from apache/ebtree-lookup-optRobert Newson2021-02-281-4/+4
|\ | | | | Optimize lookup/3
| * Optimize lookup/3ebtree-lookup-optRobert Newson2021-02-271-4/+4
|/ | | | | A tidier version of https://github.com/apache/couchdb/pull/3384 that saves an unnecessary call to collate.
* Merge pull request #3384 from apache/ebtree-lookup-collate-eqRobert Newson2021-02-261-6/+6
|\ | | | | use collate in lookup
| * use collate in lookupRobert Newson2021-02-261-6/+6
| |
* | Fix ebtree:lookup_multi/3Paul J. Davis2021-02-261-6/+5
| | | | | | | | | | | | | | If one of the provided lookup keys doesn't exist in the ebtree, it can inadvertently prevent a second lookup key from being found if it the first key greater than the missing lookup key is equal to the second lookup key.
* | Add failing cases for ebtree:lookup_multi/3 bugPaul J. Davis2021-02-262-1/+28
| | | | | | | | | | | | These two test cases expose the subtle bug in ebtree:lookup_multi/3 where a key that doesn't exist in the tree can prevent a subsequent lookup key from matching in the same KV node.
* | Fix typoPaul J. Davis2021-02-261-8/+8
| |
* | Merge pull request #3365 from apache/active-tasks-process-status-mainRobert Newson2021-02-091-1/+10
|\ \ | |/ | | Show process status in active_tasks
| * Show process status in active_tasksRobert Newson2021-02-091-1/+10
|/ | | | | This allows users to verify that compaction processes are suspended outside of any configured strict_window.
* Handle all erlfdb error codes (#3355)Robert Newson2021-02-082-28/+6
|
* Fix PUT of multipart/related attachments support for Transfer-Encoding: ↵Bessenyei Balázs Donát2021-02-033-2/+22
| | | | | | | chunked (#3360) Transfer-Encoding: chunked causes the server to wait indefinitely, then issue a a 500 error when the client finally hangs up, when PUTing a multipart/related document + attachments. This commit fixes that issue by adding proper handling for chunked multipart/related requests.
* Add a development container for VS Code (#3343)Adam Kocoloski2021-01-257-2/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* fix additional links after branch renaming (master -> main)Ronny2021-01-253-6/+6
|
* fixing links after master->main branch renamebig-r812021-01-251-2/+2
|
* Simplify and speedup dev node startup (main branch) (#3338)Adam Kocoloski2021-01-216-155/+69
| | | | | | | | | | | | | | | | | | | | * Simplify and speedup dev node startup This patch introduces an escript that generates an Erlang .boot script to start CouchDB using the in-place .beam files produced by the compile phase of the build. This allows us to radically simplify the boot process as Erlang computes the optimal order for loading the necessary modules. In addition to the simplification this approach offers a significant speedup when working inside a container environment. In my test with the stock .devcontainer it reduces startup time from about 75 seconds down to under 5 seconds. * Rename boot_node to monitor_parent * Add formatting suggestions from python-black Co-authored-by: Paul J. Davis <paul.joseph.davis@gmail.com>
* add http error for fdb 1031Garren Smith2021-01-181-0/+5
|
* remove {restart_tx, true} from mango _all_docsGarren Smith2021-01-181-2/+1
|
* Update README.mdRobert Newson2021-01-151-6/+0
| | | 1. The caching effort was a bust and has been removed. 2) chunkify can be done externally with a custom persist_fun.
* Allow gzipped requests to _session (#3323)Bessenyei Balázs Donát2021-01-123-3/+14
| | | | | All endpoints but _session support gzip encoding and there's no practical reason for that. This commit enables gzip decoding on compressed requests to _session.
* Switch from assert length === 0 to Enum.empty? as Credo suggestsAlessio Biancalana2021-01-031-1/+1
|
* Add to credo ignores and gitignore new file_system dependencyAlessio Biancalana2021-01-032-0/+2
|
* Upgrade Credo to 1.5.4Alessio Biancalana2021-01-032-3/+4
|
* Goodbye 2020. Hello 2021. YES. (#3318)Joan Touzet2021-01-011-1/+1
|
* treat 408 as a retryable error condition (#3303)Robert Newson2020-12-201-18/+18
|
* Merge pull request #3286 from cloudant/specify-elixir-testsiilyak2020-12-027-17/+1165
|\ | | | | Add ability to control which Elixir integration tests to run
| * Use elixir-suiteILYA Khlopotov2020-12-021-1/+1
| |
| * Add ability to control which Elixir integration tests to runILYA Khlopotov2020-12-027-16/+1164
|/ | | | | | | | | | | | | | | | New `elixir-suite` Makefile target is added. It runs a predefined set of elixir integration tests. The feature is controlled by two files: - test/elixir/test/config/suite.elixir - contains list of all available tests - test/elixir/test/config/skip.elixir - contains list of tests to skip In order to update the `test/elixir/test/config/suite.elixir` when new tests are added. The one would need to run the following command: ``` MIX_ENV=integration mix suite > test/elixir/test/config/suite.elixir ```
* Add missing default headers to responses (#3279)Bessenyei Balázs Donát2020-11-234-3/+23
| | | | Add missing default headers to responses
* Remove unnecessary line wrapsPaul J. Davis2020-11-171-4/+2
|
* Minimize conflicts while building viewsPaul J. Davis2020-11-172-8/+91
| | | | | | | | | | This flips the view indexer to grab the database update_seq outside of the update transaction. Previously we would cosntantly refresh the db_seq value on every retry of the transactional loop. We use a snapshot to get the update_seq so that we don't trigger spurious read conflicts with any clients that might be updating the database.
* Allow specifying an end_key for fold_changesPaul J. Davis2020-11-172-7/+22
| | | | | | | This is useful so that read conflicts on the changes feed will eventually be resolved. Without an end key specified a reader could end up in an infinite conflict retry loop if there are clients updating documents in the database.
* Allow snapshots through fabric2_fdb:transactionalPaul J. Davis2020-11-172-0/+151
|
* Merge pull request #3274 from cloudant/fix-mango-testsiilyak2020-11-172-1/+5
|\ | | | | Fix mango tests
| * Disable TextIndex test since it is not implemeneted yetILYA Khlopotov2020-11-171-0/+4
| |
| * `q` and `n` are not needed for FDB based CouchDBILYA Khlopotov2020-11-171-1/+1
|/
* Bump erlfdb to v1.2.3Nick Vatamaniuc2020-11-161-1/+1
| | | | https://github.com/apache/couchdb-erlfdb/releases/tag/v1.2.3
* Merge pull request #3268 from cloudant/reuse-json-bodyiilyak2020-11-161-2/+5
|\ | | | | Use `req_body` field if present
| * Use `req_body` field if presentILYA Khlopotov2020-11-161-2/+5
|/ | | | | | | When we call `couch_httpd:json_body/1` we can have `req_body` already set. In this case we should return the field as is without any attempt to decompress or decode it. This PR brings the approach we use in `chttpd` into `couch_httpd`.
* Merge pull request #3263 from apache/fix-ebtree-range-clearsRobert Newson2020-11-121-2/+2
|\ | | | | Avoid deleting UUID keys that start with zeros
| * Assure that all node ids are the same lengthRobert Newson2020-11-121-1/+1
| |
| * Avoid deleting UUID keys that start with zerosPaul J. Davis2020-11-121-1/+1
|/ | | | | Any ebtree that uses chunked key encoding will accidentally wipe out any nodes that have a UUID with more than one leading zero byte.
* Fix flaky testPaul J. Davis2020-11-101-2/+8
| | | | | | | | | Waiting for the timeout option to be set means we could still sneak in and grab the old FDB database handle before fabric2_server updated it in the application environment. This new approach just waits until the handle has been updated by watching the value in the application environment directly.
* Remove use of cachingPaul J. Davis2020-11-101-27/+1
| | | | | Turns out that ebtree caching wasn't quite correct so removing it for now.
* Remove ebtree cachingPaul J. Davis2020-11-101-112/+18
| | | | | | | | The ebtree caching layer does not work correctly in conjunction with FoundationDB transaction retry semantics. If we incorrectly cache nodes that are not actually read from FoundationDB, a retried transaction will rely on incorrectly cached state and corrupt the ebtree persisted in FoundationDB.
* Merge pull request #3244 from apache/aegis_db_infoRobert Newson2020-11-064-1/+29
|\ | | | | Add an "encryption" object to db info
| * Add an "encryption" object to db infoaegis_db_infoRobert Newson2020-11-064-1/+29
| | | | | | | | | | | | The encryption object contains a boolean "enabled" property. Additional properties might be added by the key manager which will appear in the "key_manager" sub-object.
* | Merge pull request #3248 from apache/changes_filter_all_docs_oom_mainRobert Newson2020-11-062-1/+68
|\ \ | | | | | | Retry filter_docs sequentially if the patch exceeds couchjs stack
| * | Add test for splitting filter batchesPaul J. Davis2020-11-061-0/+55
| | |
| * | Retry filter_docs sequentially if the patch exceeds couchjs stackRobert Newson2020-11-061-1/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | A document with lots of conflicts can blow up couchjs if the user calls _changes with a javascript filter and with `style=all_docs` as this option causes up to fetch all the conflicts. All leaf revisions of the document are then passed in a single call to ddoc_prompt, which can fail if there's a lot of them. In that event, we simply try them sequentially and assemble the response from each call. Should be backported to 3.x