You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2025/11/13 19:42:46 UTC

(couchdb) branch reset-docs-size-in-scanner-plugin updated (b7d754152 -> d0878cae3)

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a change to branch reset-docs-size-in-scanner-plugin
in repository https://gitbox.apache.org/repos/asf/couchdb.git


 discard b7d754152 Reset docs_size in quickjs scanner
     new d0878cae3 Reset docs_size in quickjs scanner

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   (b7d754152)
            \
             N -- N -- N   refs/heads/reset-docs-size-in-scanner-plugin (d0878cae3)

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:


(couchdb) 01/01: Reset docs_size in quickjs scanner

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch reset-docs-size-in-scanner-plugin
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d0878cae3b7ad0e32e785beef125c4c69cc4ce86
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Thu Nov 13 14:20:46 2025 -0500

    Reset docs_size in quickjs scanner
    
    When we switch dbs make sure to reset db specific stuff. It's probably overkill
    to do it in multiple places, but it doesn't hurt either.
---
 src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl b/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
index 91385010c..3e4a545a7 100644
--- a/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
+++ b/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
@@ -150,7 +150,7 @@ db_opened(#st{} = St, Db) ->
     #st{max_docs = MaxDocs, max_step = MaxStep} = St,
     {ok, DocTotal} = couch_db:get_doc_count(Db),
     Step = min(MaxStep, max(1, DocTotal div MaxDocs)),
-    {0, [], St#st{doc_cnt = 0, doc_step = Step, docs = []}}.
+    {0, [], St#st{doc_cnt = 0, docs_size = 0, doc_step = Step, docs = []}}.
 
 doc_id(#st{} = St, <<?DESIGN_DOC_PREFIX, _/binary>>, _Db) ->
     {skip, St};
@@ -436,6 +436,7 @@ reset_per_db_state(#st{qjs_proc = QjsProc, sm_proc = SmProc} = St) ->
     St#st{
         ddocs = #{},
         docs = [],
+        docs_size = 0,
         qjs_proc = undefined,
         sm_proc = undefined,
         ddoc_cnt = 0