summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* feat: work around get_stacktrace deprecation/removalerlang-23-for-mainJan Lehnardt2021-04-1816-82/+77
| | | | | | | | | | | This patch introduces a macro and inserts it everywhere we catch errors and then generatre a stacktrace. So far the only thing that is a little bit ugly is that in two places, I had to add a header include dependency on couch_db.erl where those modules didn’t have any ties to couchdb/* before, alas. I’d be willing to duplicate the macros in those modules, if we don’t want the include dependency.
* Clean up Makefiles and start running all the unit testsNick Vatamaniuc2021-04-162-4/+4
| | | | | | | | | | * Remove non-existent applications * Most importantly, start running all the unit test. This should include 500+ new couch tests. * Noticed `local` application was flaky and periodically timing out in CI. Since it's a transitive dependency of jaeger, let's skip running it for now. It's a bit in the same category as brcypt, meck and hyper.
* Update ./dev/run to not auto-create _global_changesNick Vatamaniuc2021-04-161-1/+1
|
* Clean up tests after removing 3.x applications and couch_views updatesNick Vatamaniuc2021-04-1622-216/+59
| | | | | | | | | | | | | | * Update the couch_views include paths * Exclude non-existent applications from setup logic * Do not run tests agains the backdoor port * Do not run tests checking for non-existent system dbs * Since "new" couch_att attachment format has changed a bit and encoding is not `identity` and `md5` is not `<<>>` any longer, some tests had to be updated to set those explicitly.
* Update all the applications to use the new couch_views utility functionsNick Vatamaniuc2021-04-1622-58/+68
| | | | | | | | | | This is mostly a bulk search and replace to update fabric, couch_views, chttpd, mango and couch_replicator to use either the new included file or the new utility functions in couch_views. The `couch_views_http:transform_row/2` function was brought from the removed`fabric_view` module. It's used in only one place to it was copied there directly.
* Clean up couch_auth_cacheNick Vatamaniuc2021-04-161-91/+2
| | | | | | | | couch_auth_cache only handles reading server admin credentials from config files and returns the auth design doc (used in chttpd_auth_cache). Node local `_user` docs logic has been removed. Validation to check for _conflicts is also not needed as the "docs" proplists created from the config server admin section don't have conflicts.
* Clean up database name validation in fabric2_dbNick Vatamaniuc2021-04-161-17/+7
| | | | | | | | `normalize_dbname/1` is not needed as database names do not have the `.couch` suffix, and we don't have shard paths any more. For validation, send the `DbName` to the `fabric2_db_plugin` as both the real DbName and the "normalized" one. This is mostly to avoid changing the plugin interface for now and should be eventually updated (in a separate PR).
* Remove mem3_sync:get_backlog/0 call from stats in chttpd_nodeNick Vatamaniuc2021-04-161-1/+0
|
* Move utilities and records from couch_mrview and couch_index to couch_viewsNick Vatamaniuc2021-04-165-5/+1018
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * `couch_mrview_util` functions ended up mostly in `couch_views_util`. * `couch_mrview` validatation functions ended up in `couch_views_validate` module. * `couch_mrview_http` functions moved to `couch_views_http_util`. The reason they didn't end up in `couch_views_http` is because a lot of the functions there have the exact same names as the ones in `couch_views_http_util`. There is quite a bit of duplication involved but that is left for another refactoring in the future. The general flow of control goes from chttpd -> couch_views_http -> couch_views_http_util. Most of the changes are just copy and paste with the exception of the `ddoc_to_mrst/2` function. Previously, there were two almost identical copies -- one in `couch_mrview_util` and another in `couch_views_util`. Both were used by different parts of the code. The difference was the couch_views one optionally disabled reduce functions, and replaced their body with the `disabled` atom, while the one in `couch_mrview` didn't. Trying to unify them such that only the `couch_views` one is used, resulted in the inability to write design documents on server which have custom reduce disabled. That may be a better behavior, however that should be updated in a separate PR and possibly a mailing list discussion. So in order to preserve the exisiting behavior, couch_eval was update to not fail in `try_compile` when design documents are disabled. Patches to the rest of the code to update the include path and use the new utility functions will be updated in a separate commit.
* Remove clouseau and dreyfus references from mangoNick Vatamaniuc2021-04-162-22/+3
| | | | | | Try to minimize changes and cheated a bit by returning `false` from `is_text_service_available()`. Also keeping in mind that we'd probably want this functionality in the future.
* Clean up couch_db.hrlNick Vatamaniuc2021-04-162-47/+1
| | | | Un-used defines and records are removed
* Remove couch_db_plugin from couch_db_epi servicesNick Vatamaniuc2021-04-161-1/+0
| | | | It was replaced by fabric2_db_plugin
* Update couch_util to remove couch_db and mem3 callsNick Vatamaniuc2021-04-161-23/+3
| | | | Also remove the with_db/2 function as it's not used any longer
* Remove rewrite support from couch_js and couch_query_serversNick Vatamaniuc2021-04-162-159/+0
|
* Update couch_(js_)os_process after ioq removalNick Vatamaniuc2021-04-162-2/+2
| | | | | Remove ioq call from `couch_os_process:prompt/2` and `couch_js_os_process:prompt/2`
* Remove most of the functionality from couch_serverNick Vatamaniuc2021-04-161-856/+16
| | | | | | | | | | | | | | | | | | | Remove all the code related to opening and caching of databases. However, couch_server did a few other things such as: * Parse and maintain the CouchDB version * Return the server "uuid" value * The gen_server was monitoring config updates and hashing admin passwords when they were updated It was a 50/50 decision to move that functionality out to other modules completely or keep it where it is. Since it wasn't just a single thing, and the overall PR was getting rather large, opted to pair the exisiting code to the minimum, and then later we can do another round of cleanup and find a better place for those features.
* Clean up couch_docNick Vatamaniuc2021-04-163-58/+5
| | | | | | | | The main change is to remove `validate_docid/1,2` and use `fabric2_db:validate_docid/1` instead. `with_ejson_body` is also not needed as request bodies are parsed to ejson and fabric2_fdb also deserializes to ejson.
* Update couch_flags to remove knowledge about shardsNick Vatamaniuc2021-04-161-12/+4
| | | | | | | Remove shard handling from `couch_flags`. `couch_db:normalize_dbname/1` call is not necessary as db names are not shards and do not have the `.couch` extension any more.
* Clean up couch_debugNick Vatamaniuc2021-04-161-38/+0
| | | | | | Remove logic handling index directories and couch_files. Definitely not a comprehensive cleanup. We should probably have a separate PR to pick out what would be useful for `main`.
* Update couch_secondary_sup to not start index_serverNick Vatamaniuc2021-04-161-1/+0
| | | | Index server is gone and replaced by couch_views + couch_jobs applications.
* Remove commented out tests from couch_attNick Vatamaniuc2021-04-161-189/+0
| | | | | | Many of those tests check attachemnt upgrades from older 1-3.x formats, check the `follows` functionality which is not supported in FDB (we don't stream attachments but buffer them outside transactions), or import couch_bt_engine.
* Update couch_primary_sup to not start couch_task_status childNick Vatamaniuc2021-04-161-6/+0
| | | | | `couch_task_status` is removed. `_active_tasks` endpoint is driven by the `couch_jobs` application.
* Close backend port and clean up url handlersNick Vatamaniuc2021-04-1612-751/+112
| | | | | | | | | | | | | | | | | | | | | | Backend (5986) port is closed. Requests to `/_node/_local/_config` and a few other `_*` endpoints continues to work. Backend db access now returns error code 410 (not_supported). Previously, it was accessing couch_server and couch_files to create 3.x style local dbs. Url handlers are updated to return `not_supported` for features which are not coming back, and `not_implemented` for features which haven't been implemented yet. `parse_copy_destination_header/1` is the only function from `couch_httpd_db` that's still needed, so it was moved to `chttpd_util` module. `couch_httpd_db` handled `/_uuid` requests and that handler was moved to `chttpd_misc` module. "Welcome" endpoint (/) was updated to not call `clouseau_rpc:connected/0`. Request handling in `couch_httpd` was removed, so most of the file is now a bunch of utility functions mostly.
* Clean up config filesNick Vatamaniuc2021-04-162-227/+1
| | | | | | | | | | | Remove default.ini and local.ini sections related to applications and functionality which is no longer there. One odd change is the commented out`partitioned` flag. The reason is because the "flags" logic is kept, and seems to be functional, however partitioned flag is not functional. `couch_flags` loads flags using `list_to_existing_atom/1` and since `partitioned` is not an existing atom it continuously emits crash logs from the `_up` point related to that.
* Delete non-functional 3.x applications and modules from mainNick Vatamaniuc2021-04-16371-75257/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Affected applications fall in a few categories: 1. Applications which are not used any more: * rexi * mem3 * ddoc_cache * smoosh * ken * ioq * dreyfus * couch_event * snappy * kash * couch_plugins 2. Applications we intend to keep for 4.x, but in their current form they rely on 3.x architecture (mem3, couch_file, clustering). These applications when they are ready to be implemented should be copied from 3.x as they will be more recent there: * couch_peruser * global_changes * setup 3. Applications used only for utility functions, those function will be moved to other applications: * couch_mrview * couch_index 4. Applications where some modules have been removed and some stayed: * couch: - removed: couch_db_*, couch_btree, couch_file, couch_lru, etc. - kept: couch_doc, key tree and some others stayed - couch_server: stripped down only to functions which are still used, serving uuids, returning couch version and hashing passwords. It's a candidate to update in a separate PR to split that functionality to other modules (couch_passwords, fabric2_server). * fabric: - removed: all fabric_rpc modules - kept: fabric2_* modules * mango: - removed clouseau pings and check for "text" service
* Add docker creds to CI run (#3508) (#3509)Joan Touzet2021-04-142-0/+24
|
* Merge pull request #3416 from apache/prometheus-endpointTony Sun2021-04-1316-3/+775
|\ | | | | Prometheus endpoint
| * add license to missing filesprometheus-endpointTony Sun2021-04-133-7/+15
| |
| * add prometheus versioning to headerTony Sun2021-04-134-3/+11
| |
| * add eunit testsTony Sun2021-04-132-2/+152
| |
| * add configurable http serverTony Sun2021-04-138-10/+116
| | | | | | | | | | | | We add an option to spawn a new mochiweb_http server to allow for an additional port for scraping which does not require authentication. The default ports are 17986, 27986, 37986 across 3 nodes.
| * Add new app couch_prometheusTony Sun2021-04-1311-1/+501
|/ | | | | | | | | | | | This will be a new app add a _prometheus endpoint which will return metrics information that adheres to the format described at https://prometheus.io/. Initial implementation of new _prometheus endpoint. A gen_server waits for scraping calls while polling couch_stats:fetch and other system info. The return value is constructed to adhere to prometheus format and returned as text/plain. The format code was originally written by @davisp.
* Fix publish stageBessenyei Balázs Donát2021-04-081-1/+2
|
* Disable arm64v8Bessenyei Balázs Donát2021-04-081-0/+1
|
* Increase timeouts for flaky testsBessenyei Balázs Donát2021-04-081-3/+3
| | | | Increase timeout for continuous filtered changes with doc ids and for eventsource changes
* Add support for Spidermonkey 78 (#3501)Joan Touzet2021-04-083-15/+17
|
* Bump erlfdb to v1.3.3Nick Vatamaniuc2021-04-061-1/+1
| | | | | | To bring in a future `timeout` fix: * https://github.com/apache/couchdb-erlfdb/commit/55022a566df3d98a543148ce7a0e2eb6773909ae
* Retryable error fixes in couch_jobs_type_monitorNick Vatamaniuc2021-04-061-4/+17
| | | | | | | | | | | | | | | This continues improvements to retryable error handling started in https://github.com/apache/couchdb/pull/3460. Here we add the same logic we already have for the `erlfdb:wait/2` call in https://github.com/apache/couchdb/blob/main/src/couch_jobs/src/couch_jobs_type_monitor.erl#L55-L57 to the `get_vs_and_watch/1` section. couch_jobs_type_monitor is meant to be linked to and run in a continuous loop as long as the parent process is alive. If FDB becomes unavailable the main process which we linked to or other main component (the whole application) should crash and fail as opposed to the type monitor itself. Still, to avoid running in a tight loop we use the holdoff interval to sleep a bit before recursing. The typical values of the holdoff is around 50-100 msec.
* remove couch_index_server:validategarren smith2021-04-062-21/+2
| | | | | | This makes it that the only way to validate a design doc is through couch_mrview:validate_ddoc so that the correct couch_eval will be used.
* Validate ddoc uses couch_evalgarren smith2021-04-069-26/+94
| | | | | | Change the validate ddoc check to use couch_eval. Also add in some extra functions in couch_eval so that the try_compile will work.
* Fix collation issue for older versions of libicu libraryNick Vatamaniuc2021-04-051-0/+40
| | | | | | | | | | | Previously, mango tests with objects as keys were failing on CentOS 6 and CentOS 7. The reason for the failures was that old libicu collation algorithms didn't consider the `<<255,255,255,255>>` as the highest sortable string as CouchDB intends it to be. Later versions of libicu, at least as old as 59, started to do that https://www.unicode.org/reports/tr35/tr35-collation.html#tailored_noncharacter_weights. However, as long as we support CentOS 7 we can fix the issue by explicitly checkign for the highest marker.
* Merge pull request #3485 from cloudant/configurable_filter_fieldsiilyak2021-04-016-10/+79
|\ | | | | Configurable filter fields
| * Make silly list configurableILYA Khlopotov2021-03-316-5/+71
| |
| * Document strip_last_msg in default.iniILYA Khlopotov2021-03-311-0/+2
| |
| * Display name of testsILYA Khlopotov2021-03-311-6/+7
| |
* | Improve search for FDB cluster files (#3468)Adam Kocoloski2021-03-311-3/+147
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a handful of related improvments to the code that chooses the FoundationDB cluster file. We now check for a cluster file in multiple locations, in priority order: 1. The value of `[erlfdb] cluster_file` in the server config 2. The value of the FDB_CLUSTER_FILE environment variable 3. The default platform-dependent location(s) Unix-y systems: /usr/local/etc/foundationdb/fdb.cluster (MacOS package default) /etc/foundationdb/fdb.cluster (Linux packages default) Windows: C:/ProgramData/foundationdb/fdb.cluster We also check that the file has appropriate access permissions, namely that is RW accessible by the user running CouchDB. If the file is read-only we emit a warning but allow the startup to proceed. Finally, we add some more detailed logging to help users debug any problems in this department on startup. If a location is specified using either one of the first two "custom" approaches and there is a problem with that location, CouchDB will abort rather than try any further option. This avoids a situation where a user intended to override the default cluster file but CouchDB starts up with the default one because e.g. the user failed to actually install the new file with the correct permissions.
* Bump erlfdb to v1.3.2Nick Vatamaniuc2021-03-301-1/+1
| | | | https://github.com/apache/couchdb-erlfdb/releases/tag/v1.3.2
* Refactor config_test.exs (#3465)Bessenyei Balázs Donát2021-03-302-14/+3
|
* Improve retryable FDB error handlingNick Vatamaniuc2021-03-2610-28/+44
| | | | | | | | | | | After running the Elixir suite under the buggify" mode, we noticed retryable errors were not handled well. In some cases we handled some errors (1009) but not others (1007, 1031). Some other retryable errors were not considered at all. So here we use the newly defined constants and `ERLFDB_IS_RETRYABLE/2` guard from erlfdb v1.3.1 to make handling of these errors a bit more consistent.
* Remove compact elixir test (#3459)Bessenyei Balázs Donát2021-03-253-94/+0
|