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/24 22:16:15 UTC

(couchdb) branch nouveau-update-bundle updated (78d6f92eb -> 08b44537f)

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

rnewson pushed a change to branch nouveau-update-bundle
in repository https://gitbox.apache.org/repos/asf/couchdb.git


 discard 78d6f92eb commit purge seq update before returning
     new 08b44537f commit purge seq update before returning

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   (78d6f92eb)
            \
             N -- N -- N   refs/heads/nouveau-update-bundle (08b44537f)

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:
 .../main/java/org/apache/couchdb/nouveau/api/IndexInfoRequest.java | 7 ++++++-
 .../java/org/apache/couchdb/nouveau/resources/IndexResource.java   | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)


(couchdb) 01/01: commit purge seq update before returning

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

rnewson pushed a commit to branch nouveau-update-bundle
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 08b44537f96059f90f204ecd088206e49369cf0b
Author: Robert Newson <rn...@apache.org>
AuthorDate: Tue Mar 24 21:34:23 2026 +0000

    commit purge seq update before returning
---
 .../java/org/apache/couchdb/nouveau/api/IndexInfoRequest.java  | 10 +++++++++-
 .../org/apache/couchdb/nouveau/resources/IndexResource.java    |  6 ++++++
 src/nouveau/src/nouveau_api.erl                                |  3 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/api/IndexInfoRequest.java b/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/api/IndexInfoRequest.java
index bc2f016f8..f23113a09 100644
--- a/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/api/IndexInfoRequest.java
+++ b/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/api/IndexInfoRequest.java
@@ -15,7 +15,9 @@ package org.apache.couchdb.nouveau.api;
 
 import com.fasterxml.jackson.databind.PropertyNamingStrategies;
 import com.fasterxml.jackson.databind.annotation.JsonNaming;
+import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.PositiveOrZero;
+import java.util.Optional;
 import java.util.OptionalLong;
 
 @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@@ -23,4 +25,10 @@ public record IndexInfoRequest(
         @PositiveOrZero OptionalLong matchUpdateSeq,
         @PositiveOrZero OptionalLong updateSeq,
         @PositiveOrZero OptionalLong matchPurgeSeq,
-        @PositiveOrZero OptionalLong purgeSeq) {}
+        @PositiveOrZero OptionalLong purgeSeq,
+        @NotNull Optional<Boolean> commit) {
+
+    public boolean shouldCommit() {
+        return commit.orElse(false);
+    }
+}
diff --git a/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java b/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
index 18539fbed..182152a5d 100644
--- a/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
+++ b/extra/nouveau/src/main/java/org/apache/couchdb/nouveau/resources/IndexResource.java
@@ -99,14 +99,20 @@ public final class IndexResource {
     @POST
     public Ok setIndexInfo(@PathParam("name") String name, @NotNull @Valid IndexInfoRequest request) throws Exception {
         return indexManager.with(name, (index) -> {
+            var shouldCommit = false;
             if (request.matchUpdateSeq().isPresent() && request.updateSeq().isPresent()) {
                 index.setUpdateSeq(
                         request.matchUpdateSeq().getAsLong(),
                         request.updateSeq().getAsLong());
+                shouldCommit = true;
             }
             if (request.matchPurgeSeq().isPresent() && request.purgeSeq().isPresent()) {
                 index.setPurgeSeq(
                         request.matchPurgeSeq().getAsLong(), request.purgeSeq().getAsLong());
+                shouldCommit = true;
+            }
+            if (shouldCommit && request.shouldCommit()) {
+                index.commit();
             }
             return Ok.INSTANCE;
         });
diff --git a/src/nouveau/src/nouveau_api.erl b/src/nouveau/src/nouveau_api.erl
index 8c85ec910..2e8b1c37d 100644
--- a/src/nouveau/src/nouveau_api.erl
+++ b/src/nouveau/src/nouveau_api.erl
@@ -284,7 +284,8 @@ set_update_seq(#index{} = Index, MatchSeq, UpdateSeq) ->
 set_purge_seq(#index{} = Index, MatchSeq, PurgeSeq) ->
     ReqBody = #{
         match_purge_seq => MatchSeq,
-        purge_seq => PurgeSeq
+        purge_seq => PurgeSeq,
+        commit => true
     },
     set_seq(Index, ReqBody).