This is an automated email from the ASF dual-hosted git repository. jiahuili430 pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push: new 33c08bee5 Fix config options (#5642) 33c08bee5 is described below commit 33c08bee542599253526f856956aeaab7488bd10 Author: Jiahui Li <lijiahui...@gmail.com> AuthorDate: Wed Sep 24 08:06:12 2025 -0500 Fix config options (#5642) * Config: `secret` was moved to `[chttpd_auth]` session * Docs: `changes_timeout` is applicable for `_changes?feed=eventsource` * [couchdb]: Add `delete_after_rename = true` option - Update comments for `enable_database_recovery = false`. - Add `delete_after_rename = true` option: - No ops when `enable_database_recovery = true`. - If `true`, delete the database shard files from the `data` directory. - If `false`, rename the database shard files and move them to the `.delete` directory. * [fabric]: `attachments_timeout` default should be `600000` * [view_updater]: Add `queue_memory_cap` and `queue_item_cap` * [fabric]: Make `all_docs_view_permsg_timeout = 5000` configurable * Fix typos --- rel/overlay/etc/default.ini | 47 +++++++++++++++++++++---------- src/docs/src/api/database/changes.rst | 5 ++-- src/dreyfus/src/dreyfus_fabric_group1.erl | 4 +-- src/dreyfus/src/dreyfus_fabric_group2.erl | 4 +-- src/fabric/src/fabric_view_all_docs.erl | 2 +- src/fabric/src/fabric_view_changes.erl | 2 +- src/setup/test/t-frontend-setup.sh | 4 +-- 7 files changed, 43 insertions(+), 25 deletions(-) diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini index 63db3f854..db4d37f3e 100644 --- a/rel/overlay/etc/default.ini +++ b/rel/overlay/etc/default.ini @@ -71,11 +71,18 @@ view_index_dir = {{view_index_dir}} ;default_engine = couch ; Enable this to only "soft-delete" databases when DELETE /{db} requests are -; made. This will place a .recovery directory in your data directory and -; move deleted databases/shards there instead. You can then manually delete -; these files later, as desired. +; made. This will add `.deleted.couch` extension to the database shard files +; in the data directory. You can then manually delete these files later, as +; desired. ;enable_database_recovery = false +; Applies only when `enable_database_recovery = false`. +; When DELETE /{db} requests are made: +; - If `true`, delete the database shard files from the `data` directory. +; - If `false`, rename the database shard files and move them to the `.delete` +; directory. +;delete_after_rename = true + ; Set the maximum size allowed for a partition. This helps users avoid ; inadvertently abusing partitions resulting in hot shards. The default ; is 10GiB. A value of 0 or less will disable partition size checks. @@ -116,7 +123,7 @@ view_index_dir = {{view_index_dir}} ; When enabled, use cfile parallel reads for all the requests. By default the ; setting is "false", so only requests which are configured to bypass the IOQ ; would use the cfile parallel reads. If there is enough RAM available for a -; large file cache and the disks have enough IO bandwith, consider enabling +; large file cache and the disks have enough IO bandwidth, consider enabling ; this setting. ;cfile_skip_ioq = false @@ -257,7 +264,7 @@ bind_address = 127.0.0.1 ; Set to false to revert to a previous _bulk_get implementation using single ; doc fetches internally. Using batches should be faster, however there may be -; bugs in the new new implemention, so expose this option to allow reverting to +; bugs in the new implementation, so expose this option to allow reverting to ; the old behavior. ;bulk_get_use_batches = true @@ -441,7 +448,8 @@ hash_algorithms = sha256, sha ;uuid_prefix_len = 7 ;request_timeout = 60000 ;all_docs_timeout = 10000 -;attachments_timeout = 60000 +;all_docs_view_permsg_timeout = 5000 +;attachments_timeout = 600000 ;view_timeout = infinity ;view_permsg_timeout = 3600000 ;partition_view_timeout = infinity @@ -468,6 +476,16 @@ hash_algorithms = sha256, sha ;update_db = true ;[view_updater] +; Configure the queue capacity used during indexing. These settings apply to +; both the queue between the changes feed and the JS mapper, and between the +; JS mapper and the disk writer. +; Whichever limit happens to be hit first is the one that takes effect. + +; The maximum queue memory size +;queue_memory_cap = 100000 +; The maximum queue length +;queue_item_cap = 500 + ;min_writer_items = 100 ;min_writer_size = 16777216 @@ -711,7 +729,7 @@ partitioned||* = true ; How much time to wait before retrying after a missing doc exception. This ; exception happens if the document was seen in the changes feed, but internal ; replication hasn't caught up yet, and fetching document's revisions -; fails. This a common scenario when source is updated while continuous +; fails. This is a common scenario when source is updated while continuous ; replication is running. The retry period would depend on how quickly internal ; replication is expected to catch up. In general this is an optimisation to ; avoid crashing the whole replication job, which would consume more resources @@ -730,7 +748,7 @@ partitioned||* = true ; couch_replicator_auth_session - use _session cookie authentication ; couch_replicator_auth_noop - use basic authentication (previous default) ; Currently, the new _session cookie authentication is tried first, before -; falling back to the old basic authenticaion default: +; falling back to the old basic authentication default: ;auth_plugins = couch_replicator_auth_session,couch_replicator_auth_noop ; To restore the old behaviour, use the following value: @@ -758,7 +776,7 @@ partitioned||* = true ; priority 0, and would render this algorithm useless. The default value of ; 0.98 is picked such that if a job ran for one scheduler cycle, then didn't ; get to run for 7 hours, it would still have priority > 0. 7 hours was picked -; as it was close enought to 8 hours which is the default maximum error backoff +; as it was close enough to 8 hours which is the default maximum error backoff ; interval. ;priority_coeff = 0.98 @@ -971,12 +989,11 @@ port = {{prometheus_port}} [custodian] ; When set to `true`, force using `[cluster] n` values as the expected n value -; of of shard copies. In cases where the application prevents creating -; non-default n databases, this could help detect case where the shard map was -; altered by hand, or via an external tools, such that it doesn't have the -; necessary number of copies for some ranges. By default, when the setting is -; `false`, the expected n value is based on the number of available copies in -; the shard map. +; of shard copies. In cases where the application prevents creating non-default +; n databases, this could help detect case where the shard map was altered by +; hand, or via an external tools, such that it doesn't have the necessary number +; of copies for some ranges. By default, when the setting is `false`, the +; expected n value is based on the number of available copies in the shard map. ;use_cluster_n_as_expected_n = false [nouveau] diff --git a/src/docs/src/api/database/changes.rst b/src/docs/src/api/database/changes.rst index cbf47b6fb..812e3b5db 100644 --- a/src/docs/src/api/database/changes.rst +++ b/src/docs/src/api/database/changes.rst @@ -115,8 +115,9 @@ the filtering criteria. :query number timeout: Maximum period in *milliseconds* to wait for a change before the response is sent, even if there are no results. - Only applicable for :ref:`longpoll <changes/longpoll>` or - :ref:`continuous <changes/continuous>` feeds. + Only applicable for :ref:`longpoll <changes/longpoll>`, + :ref:`continuous <changes/continuous>` or + :ref:`eventsource <changes/eventsource>` feeds. Default value is specified by :config:option:`chttpd/changes_timeout` configuration option. Note that ``60000`` value is also the default maximum timeout to prevent undetected dead connections. diff --git a/src/dreyfus/src/dreyfus_fabric_group1.erl b/src/dreyfus/src/dreyfus_fabric_group1.erl index 9b08a94eb..990d6d24e 100644 --- a/src/dreyfus/src/dreyfus_fabric_group1.erl +++ b/src/dreyfus/src/dreyfus_fabric_group1.erl @@ -63,8 +63,8 @@ go(DbName, DDoc, IndexName, #index_query_args{} = QueryArgs) -> #shard.ref, fun handle_message/3, State, - infinity, - 1000 * 60 * 60 + fabric_util:timeout("search", "infinity"), + fabric_util:timeout("search_permsg", "3600000") ) after rexi_monitor:stop(RexiMon), diff --git a/src/dreyfus/src/dreyfus_fabric_group2.erl b/src/dreyfus/src/dreyfus_fabric_group2.erl index 3059aa30e..613ac6555 100644 --- a/src/dreyfus/src/dreyfus_fabric_group2.erl +++ b/src/dreyfus/src/dreyfus_fabric_group2.erl @@ -68,8 +68,8 @@ go(DbName, DDoc, IndexName, #index_query_args{} = QueryArgs) -> #shard.ref, fun handle_message/3, State, - infinity, - 1000 * 60 * 60 + fabric_util:timeout("search", "infinity"), + fabric_util:timeout("search_permsg", "3600000") ) after rexi_monitor:stop(RexiMon), diff --git a/src/fabric/src/fabric_view_all_docs.erl b/src/fabric/src/fabric_view_all_docs.erl index 2d0133acb..17f522a2b 100644 --- a/src/fabric/src/fabric_view_all_docs.erl +++ b/src/fabric/src/fabric_view_all_docs.erl @@ -144,7 +144,7 @@ go(DbName, _Options, Workers, QueryArgs, Callback, Acc0) -> fun handle_message/3, State, fabric_util:view_timeout(QueryArgs), - 5000 + fabric_util:timeout("all_docs_view_permsg", "5000") ) of {ok, NewState} -> diff --git a/src/fabric/src/fabric_view_changes.erl b/src/fabric/src/fabric_view_changes.erl index df958b6b4..dd2386f5e 100644 --- a/src/fabric/src/fabric_view_changes.erl +++ b/src/fabric/src/fabric_view_changes.erl @@ -543,7 +543,7 @@ get_old_seq(#shard{range = R} = Shard, SinceSeqs) -> get_db_uuid_shards(DbName) -> % Need to use an isolated process as we are performing a fabric call from - % another fabric call and there is a good chance we'd polute the mailbox + % another fabric call and there is a good chance we'd pollute the mailbox % with returned messages Timeout = fabric_util:request_timeout(), IsolatedFun = fun() -> fabric:db_uuids(DbName) end, diff --git a/src/setup/test/t-frontend-setup.sh b/src/setup/test/t-frontend-setup.sh index e025cfba2..106312dec 100755 --- a/src/setup/test/t-frontend-setup.sh +++ b/src/setup/test/t-frontend-setup.sh @@ -64,8 +64,8 @@ curl a:b@127.0.0.1:25984/_node/node2@127.0.0.1/_config/cluster/n curl a:b@127.0.0.1:15984/_node/node1@127.0.0.1/_config/couchdb/uuid curl a:b@127.0.0.1:15984/_node/node2@127.0.0.1/_config/couchdb/uuid -curl a:b@127.0.0.1:15984/_node/node1@127.0.0.1/_config/couch_httpd_auth/secret -curl a:b@127.0.0.1:15984/_node/node2@127.0.0.1/_config/couch_httpd_auth/secret +curl a:b@127.0.0.1:15984/_node/node1@127.0.0.1/_config/chttpd_auth/secret +curl a:b@127.0.0.1:15984/_node/node2@127.0.0.1/_config/chttpd_auth/secret echo "YAY ALL GOOD"