You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2026/03/26 08:46:20 UTC
(couchdb) branch nouveau-ken updated (f4fb9810a -> b58a68aa3)
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a change to branch nouveau-ken
in repository https://gitbox.apache.org/repos/asf/couchdb.git
discard f4fb9810a Revert "remove unused function"
new b58a68aa3 restore nouveau_index_updater:outdated
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (f4fb9810a)
\
N -- N -- N refs/heads/nouveau-ken (b58a68aa3)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/nouveau/src/nouveau_index_updater.erl | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
(couchdb) 01/01: restore nouveau_index_updater:outdated
Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch nouveau-ken
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit b58a68aa382f5a7689ee47802d0551e9d436157e
Author: Robert Newson <rn...@apache.org>
AuthorDate: Thu Mar 26 08:16:35 2026 +0000
restore nouveau_index_updater:outdated
Used by ken...
---
src/nouveau/src/nouveau_index_updater.erl | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/nouveau/src/nouveau_index_updater.erl b/src/nouveau/src/nouveau_index_updater.erl
index 5b58d1e4c..38e284a95 100644
--- a/src/nouveau/src/nouveau_index_updater.erl
+++ b/src/nouveau/src/nouveau_index_updater.erl
@@ -18,7 +18,7 @@
-include("nouveau.hrl").
%% public api
--export([get_db_info/1]).
+-export([outdated/1, get_db_info/1]).
%% callbacks
-export([update/1]).
@@ -47,6 +47,21 @@
batch
}).
+outdated(#index{} = Index) ->
+ {ok, Db} = couch_db:open_int(Index#index.dbname, []),
+ try
+ case open_or_create_index(Db, Index) of
+ {ok, #{} = Info} ->
+ #{<<"update_seq">> := IndexUpdateSeq, <<"purge_seq">> := IndexPurgeSeq} = Info,
+ {DbUpdateSeq, DbPurgeSeq} = get_db_info(Db),
+ DbUpdateSeq > IndexUpdateSeq orelse DbPurgeSeq > IndexPurgeSeq;
+ {error, Reason} ->
+ {error, Reason}
+ end
+ after
+ couch_db:close(Db)
+ end.
+
update(#index{} = Index) ->
{ok, Db} = couch_db:open_int(Index#index.dbname, []),
try
@@ -219,12 +234,14 @@ open_or_create_index(Db, #index{} = Index) ->
get_db_info(#index{} = Index) ->
{ok, Db} = couch_db:open_int(Index#index.dbname, []),
try
- UpdateSeq = couch_db:get_update_seq(Db),
- PurgeSeq = couch_db:get_purge_seq(Db),
- {UpdateSeq, PurgeSeq}
+ get_db_info(Db)
after
couch_db:close(Db)
- end.
+ end;
+get_db_info(Db) ->
+ UpdateSeq = couch_db:get_update_seq(Db),
+ PurgeSeq = couch_db:get_purge_seq(Db),
+ {UpdateSeq, PurgeSeq}.
index_definition(#index{} = Index, InitialPurgeSeq) ->
#{