summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'main' into jenkins-ci-enable-freebsdjenkins-ci-enable-freebsdJan Lehnardt2023-01-202-23/+171
|\
| * Push down field projection in mango to shardMike Rhodes2023-01-201-23/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit aims to improve Mango by reducing the data transferred to the coordinator during query execution. It may reduce memory or CPU use at the coordinator but that isn't the primary goal. Currently, when documents are read at the shard level, they are compared locally at the shard with the selector to ensure they match before they are sent to the coordinator. This ensures we're not sending documents across the network that the coordinator immediately discards, saving bandwidth and coordinator processing. This commit further executes field projection (`fields` in the query) at the shard level. This should further save bandwidth, particularly for queries that project few fields from large documents. One item of complexity is that a query may request a quorum read of documents, meaning that we need to do the document read at the coordinator and not the shard, then perform the `selector` and `fields` processing there rather than at the shard. To ensure that documents are processed consistently whether at the shard or coordinator, match_and_extract_doc/3 is added. There is still one orphan call outside match_and_extract_doc/2 to extract/2 which supports cluster upgrade and should later be removed. Shard level processing is already performed in a callback, view_cb/2, that's passed to fabric's view processing to run for each row in the view result set. It's used for the shard local selector and fields processing. To make it clear what arguments are destined for this callback, the commit encapsulates the arguments, using viewcbargs_new/2 and viewcbargs_get/2. As we push down more functionality to the shard, the context this function needs to carry with it will increase, so having a record for it will be valuable. Supporting cluster upgrades: The commit supports shard pushdown for Mango `fields` processing for situations during rolling cluster upgrades. In the state where the coordinator is speaking to an upgraded node, the view_cb/2 needs to support being passed just the `selector` outside of the new viewcbargs record. In this case, the shard will not process fields, but the coordinator will. In the situation where the coordinator is upgraded but the shard is not, we need to send the selector to the shard via `selector` and also execute the fields projection at the coordinator. Therefore we pass arguments to view_cb/2 via both `selector` and `callback_args` and have an apparently spurious field projection (mango_fields:extract/2) in the code that receives back values from the shard ( factored out into doc_member_and_extract). Both of these affordances should only need to exist through one minor version change and be removed thereafter -- if people are jumping several minor versions of CouchDB in one go, hopefully they are prepared for a bit of trouble. Testing upgrade states: As view_cb is completely separate from the rest of the cursor code, we can first try out the branch's code using view_cb from `main`, and then the other way -- the branch's view_cb with the rest of the file from main. I did both of these tests successfully.
| * Show mango_selector:match/2 call using testMike Rhodes2023-01-201-0/+25
| | | | | | | | | | | | | | I needed to understand the format of arguments to `match/2` when writing the code to support projecting fields on the shard, so I wrote some code to figure it out as a test. I figure this may be useful for future work in this area, so push as commit.
* | ci(freebsd): re-enable full platform ci on FreeBSDJan Lehnardt2023-01-201-6/+11
|/
* ci(mac): re-enable mac CI for the full buildJan Lehnardt2023-01-191-6/+5
|
* Bump recon to 2.5.3Nick Vatamaniuc2023-01-181-1/+1
| | | | Changes since 2.5.2: https://github.com/ferd/recon/compare/2.5.2...2.5.3
* Adding build-report makefile target on Windows (#4384)Ronny Berndt2023-01-181-0/+5
| | | | Backporting the `build-report` target from the *nix makefile to the Windows pendant.
* Merge pull request #4379 from pgj/mango-doc-fixRobert Newson2023-01-182-3/+3
|\ | | | | docs(mango): match description of `$mod` with reality
| * docs(mango): match description of `$mod` with realityGabor Pali2023-01-182-3/+3
|/ | | | | | | | | | | | | | The remainder argument for the `$mod` operator can be zero, while its documentation suggests otherwise. It actually covers a very realistic use case where divisibility is expressed. Neither related restrictions could be identified in the sources [1] nor MongoDB forbids this [2]. Tests also seem to exercise this specific case [3]. Thanks @iilyak for checking on these. [1] https://github.com/apache/couchdb/blob/adf17140e81d0b74f2b2ecdea48fc4f702832eaf/src/mango/src/mango_selector.erl#L512:L513 [2] https://www.mongodb.com/docs/manual/reference/operator/query/mod/ [3] https://github.com/apache/couchdb/blob/0059b8f90e58e10b199a4b768a06a762d12a30d3/src/mango/test/03-operator-test.py#L58
* Set the SpiderMonkey version for the first phase of PR buildsGabor Pali2023-01-171-1/+1
|
* Ensure design docs are uploaded individually when replicating with _bulk_getNick Vatamaniuc2023-01-132-8/+93
| | | | | | | | | | | | Previously, when replication jobs used _bulk_get they didn't upload design docs individually like they do when not using _bulk_get. Here were are preserving an already existing behavior which we had in the replicator without _bulk_get usage for more than 2 years. It was introduced here in #2426. Related to these issues #2415 and #2413. Add tests to cover both attachments and ddoc cases. meck:num_calls/3 is helpful as it allows to nicely assert which API function was called and how many times.
* Delete unused include_lib attributesJay Doane2023-01-112-4/+0
| | | | Thanks, LSP!
* Fix replication _scheduler/docs total_rowsJay Doane2023-01-112-7/+78
| | | | | | | | | | | The total_rows property was decremented by one to account for the VDU that was automatically added to the total. Now that a BDU has replaced the VDU [1] total_rows is one less than it should be. This removes the decrement so that total_rows equals the actual doc count. [1] https://github.com/apache/couchdb/pull/4274
* Fixes 9a92fbb - Set default version of Spidermonkey to 91 (#4367)Ronny Berndt2023-01-110-0/+0
| | | | | | ./configure uses version 91 of Spidermonkey as default now. The previous commit (9a92fbbe3130127703db004614d836348e13ad16) stated that the source code of 1.8.5 is removed. This is not true, the code still exists, the commit message wasn't updated when updating the previous PR.
* Remove Spidermonkey 1.8.5Ronny Berndt2023-01-113-5/+5
| | | | | Removes the old Spidermonkey 1.8.5 source code. Spidermonkey 91 is set as the new default version.
* Elixir >= 1.14 doesn't support rebar2 - Remove initializationJuanjo Rodriguez2023-01-101-1/+1
|
* Wait for dbs_info 500 timeout errorJay Doane2023-01-091-7/+16
| | | | | | | | | | | | | | | | | | | With more recent OTP versions, this test has been observed to fail with the following error: chttpd_dbs_info_test:88: -dbs_info_test_/0-fun-22- (should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info)...*failed* in function chttpd_dbs_info_test:should_return_500_time_out_when_time_is_not_enough_for_get_dbs_info/1 (test/eunit/chttpd_dbs_info_test.erl, line 192) in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71) in call from eunit_proc:run_test/1 (eunit_proc.erl, line 531) in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 356) in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 514) in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 456) in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 346) in call from eunit_proc:run_group/2 (eunit_proc.erl, line 570) **error:{badmatch,{error,socket_closed_remotely}} output:<<"">> This change waits until the expected 500 timeout error is received.
* Fix handling forbidden exceptions from workers in fabric_doc_updateNick Vatamaniuc2023-01-091-1/+19
| | | | | | | | | | Previously we handled `{bad_request, Msg}` but not `{forbidden, Msg}`, so a `before_doc_update` handler which wanted to emulate the VDU `forbidden` response ended up crashing with an unhandled clause instead. (Note: The replicator doc validation BDU wasn't affected as those BDU calls are made directly from fabric since `*_replicator` shards are "special" system dbs).
* Escape special (html) chars in section names (#4350)Ronny Berndt2023-01-071-2/+3
| | | | To correctly generate the configuration reference html output, escape special html characters like '<' and '>' in section names.
* [DOC] Update required Erlang OTP versions (#4357)Ronny Berndt2023-01-071-1/+1
|
* Add Prometheus port to Windows couchdb.config (#4356)Ronny Berndt2023-01-071-0/+1
| | | Add Prometheus port to ./configure.ps1 to catch up with ./configure
* fix: debuggng leftover, speed up local rebar clonesJan Lehnardt2023-01-061-2/+1
|
* Fix replication job start_link.Nick Vatamaniuc2023-01-062-1/+26
| | | | | | | | | | | We don't want to register replication jobs with the module name as that prevents us from running more than one job at a time. This was introduced when we removed the dependence on global registrations and switched to using pg instead. Even more embarrassing is we didn't have tests to check multiple replication jobs running at the same time.
* Fix Ubuntu Jammy CI image referenceNick Vatamaniuc2023-01-051-1/+1
| | | | Just make it use the Erlang 24 version like all the other images
* doc(whatsnew): document 3.3.1 updatesJan Lehnardt2023-01-051-0/+15
|
* update version numbers to 3.3.1Jan Lehnardt2023-01-052-2/+2
|
* fix: undefined function warningJan Lehnardt2023-01-051-1/+8
|
* feat: remove failed couch_plugins experimentJan Lehnardt2023-01-059-819/+1
|
* Merge pull request #4346 from apache/find_bugsRobert Newson2023-01-042-0/+6
|\ | | | | add find_bugs makefile target for undefined functions
| * add find_bugs makefile target for undefined functionsRobert Newson2023-01-042-0/+6
|/
* Add test coverage for replicator user_ctx parserJay Doane2023-01-041-0/+7
| | | | | | | This adds a test to cover the case when a replication doc contains a user_ctx, and subsequently executes `get_json_value/3`. See: https://github.com/apache/couchdb/pull/4343
* Merge pull request #4343 from apache/fix-undef-replication-body-parseRobert Newson2023-01-041-1/+1
|\
| * fix undef when parsing replication doc bodyRobert Newson2023-01-041-1/+1
|/ | | | Closes https://github.com/apache/couchdb-fauxton/issues/1382
* Update PR template (#4338)Ronny Berndt2022-12-301-2/+3
| | | Remind committers to backport doc changes to other branches.
* Update Erlang versionsNick Vatamaniuc2022-12-292-4/+4
| | | | | | Update all 23,24,25 to latest patch versions Use 24 as a base for the full CI run
* Fix documentation to reflect default_security change3.3.0eanyanwu2022-12-221-6/+10
|
* Update release notes for 3.3.0-RC2Nick Vatamaniuc2022-12-221-0/+23
|
* Fix full CI buildNick Vatamaniuc2022-12-211-2/+0
| | | | | | Don't run erlfmt and elixir format checks We already ran those during the pull request CI phase
* Fix {eaddrnotavail} in elixir tests under WindowsRonny Berndt2022-12-212-3/+15
|
* Ignore built win binaries 2 (#4329)Ronny Berndt2022-12-211-0/+1
|
* Move elixir source checks to a separate stepNick Vatamaniuc2022-12-213-14/+21
| | | | | This is to help unblock 3.3 windows build so make check doesn't choke on re-formatting elixir files for Windows.
* Ignore built win binaries (#4323)Ronny Berndt2022-12-201-0/+3
|
* Write relax-message to standard output on Windows (#4317)Ronny Berndt2022-12-201-1/+1
|
* Reuse installed rebar and rebar3 for mixNick Vatamaniuc2022-12-201-1/+1
| | | | Instead of having it download its own every time
* Revert jiffy to CouchDB-1.0.9-2 to unblock the 3.3 releaseNick Vatamaniuc2022-12-201-1/+1
| | | | | | | Latest jiffy apparently is blocking windows builds so for now let's revert to the previous version. The previous version didn't quite work right off the bat as enc doesn't load on Erlang 25 any longer. So there is a new 1.0.9-2 release wiht enc rebuilt on Erlang 23.
* Return back to allowing offline configure and make releaseNick Vatamaniuc2022-12-194-3/+6
| | | | | | | | | At some point it broke - it looks like rebar3, erlfmt and python-black usage ended up needing the network to install/update themselves. Make sure rebar3 and erlfmt is in bin/ alongside rebar, and make python-black is in a separate source formatting stage step in CI and remove it from `make check`.
* Ensure we use the chttpd vs httpd section in fix_uriNick Vatamaniuc2022-12-171-1/+1
| | | | It's a deprecated feature but we want to make sure it still works.
* Bump version to 3.3.0Nick Vatamaniuc2022-12-162-3/+3
|
* Bump Fauxton to v1.2.9Nick Vatamaniuc2022-12-162-1/+5
|
* Update 3.3 release notes.Nick Vatamaniuc2022-12-162-1/+17
| | | | | | | | | | | | * Since the replicator optimization issues were a bit scattered, create a single parent one as a highlight, and also run somewhat more realistic benchmark tests. * Add an image macro to keep the tradition going. * Update docs section with a 5.3.0 PR which just merged. * Add reference to the newly merged `couchjs -v` enhancement.