This is an automated email from the ASF dual-hosted git repository. rnewson pushed a commit to branch nouveau-search-opt in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit c94cb291ce2d29ab1f374947df9a65ce2492a815 Author: Robert Newson <[email protected]> AuthorDate: Tue Aug 5 12:18:45 2025 +0100 allow stale queries this was bugged and caused a retry loop --- src/nouveau/src/nouveau_rpc.erl | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/nouveau/src/nouveau_rpc.erl b/src/nouveau/src/nouveau_rpc.erl index 5d954b5f3..e0b863f87 100644 --- a/src/nouveau/src/nouveau_rpc.erl +++ b/src/nouveau/src/nouveau_rpc.erl @@ -28,15 +28,24 @@ search(DbName, #index{} = Index0, QueryArgs0) -> %% Incorporate the shard name into the record. Index1 = Index0#index{dbname = DbName}, - %% get minimum seqs for search - {MinUpdateSeq, MinPurgeSeq} = nouveau_index_updater:get_db_info(Index1), + Update = maps:get(update, QueryArgs0, true), %% Incorporate min seqs into the query args. - QueryArgs1 = QueryArgs0#{ - min_update_seq => MinUpdateSeq, - min_purge_seq => MinPurgeSeq - }, - Update = maps:get(update, QueryArgs1, true), + QueryArgs1 = + case Update of + true -> + %% get minimum seqs for search + {MinUpdateSeq, MinPurgeSeq} = nouveau_index_updater:get_db_info(Index1), + QueryArgs0#{ + min_update_seq => MinUpdateSeq, + min_purge_seq => MinPurgeSeq + }; + false -> + QueryArgs0#{ + min_update_seq => 0, + min_purge_seq => 0 + } + end, %% check if index is up to date T0 = erlang:monotonic_time(),
