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 2026/09/22 19:55:42 UTC

(couchdb) branch main updated (f5e6aa5ef -> d84f6e325)

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

nickva pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


    from f5e6aa5ef Fix silent row loss in Mango _id range queries
     new e3a1a649b Add a test for mango ID collation
     new d84f6e325 Disable PPC64LE CI run

The 2 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:
 build-aux/Jenkinsfile                           | 23 ++++----
 test/elixir/test/config/suite.elixir            |  5 ++
 test/elixir/test/mango/26_id_collation_test.exs | 78 +++++++++++++++++++++++++
 3 files changed, 96 insertions(+), 10 deletions(-)
 create mode 100644 test/elixir/test/mango/26_id_collation_test.exs


(couchdb) 01/02: Add a test for mango ID collation

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

nickva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit e3a1a649b7a45ae0343713327c2ea17d39409df1
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Tue Sep 22 11:19:26 2026 -0400

    Add a test for mango ID collation
    
    This is a follow up to https://github.com/apache/couchdb/pull/6121
---
 test/elixir/test/config/suite.elixir            |  5 ++
 test/elixir/test/mango/26_id_collation_test.exs | 78 +++++++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/test/elixir/test/config/suite.elixir b/test/elixir/test/config/suite.elixir
index c392fe8df..9d4ae53da 100644
--- a/test/elixir/test/config/suite.elixir
+++ b/test/elixir/test/config/suite.elixir
@@ -903,6 +903,11 @@
     "no matches",
     "case sensitivity"
   ],
+  "IdCollationTest": [
+    "_id range find is the same as _all_docs",
+    "_id range in _changes selector",
+    "icu collation for nested _id fields"
+  ],
   "JSONIndexSelectionTest": [
     "basic",
     "with and",
diff --git a/test/elixir/test/mango/26_id_collation_test.exs b/test/elixir/test/mango/26_id_collation_test.exs
new file mode 100644
index 000000000..8e74940dc
--- /dev/null
+++ b/test/elixir/test/mango/26_id_collation_test.exs
@@ -0,0 +1,78 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+defmodule IdCollationTest do
+  use CouchTestCase
+
+  @moduledoc """
+  Doc _id comparisons in selectors should be by byte order like _all_docs. Other
+  string fields are compared by ICU collation.
+  """
+
+  @db_name "id-collation"
+
+  # As compared with byte order. With ICU it would be [a1, B0, b9, m5, Z1, zed]
+  @ids ["B0", "Z1", "a1", "b9", "m5", "zed"]
+
+  setup do
+    MangoDatabase.recreate(@db_name)
+    docs = Enum.map(@ids, fn id -> %{"_id" => id, "a" => %{"_id" => id}} end)
+    MangoDatabase.save_docs(@db_name, docs)
+    :ok
+  end
+
+  defp find(selector) do
+    {:ok, docs} = MangoDatabase.find(@db_name, selector, fields: ["_id"])
+    Enum.map(docs, fn doc -> doc["_id"] end)
+  end
+
+  defp all_docs(query) do
+    resp = Couch.get("/#{@db_name}/_all_docs", query: query)
+    assert resp.status_code == 200
+    Enum.map(resp.body["rows"], fn row -> row["id"] end)
+  end
+
+  test "_id range find is the same as _all_docs" do
+    {:ok, explain} =
+      MangoDatabase.find(@db_name, %{"_id" => %{"$gte" => "Z"}}, explain: true)
+
+    assert explain["index"]["name"] == "_all_docs"
+
+    gte_z = find(%{"_id" => %{"$gte" => "Z"}})
+    assert gte_z == all_docs(%{:startkey => "\"Z\""})
+    assert gte_z == ["Z1", "a1", "b9", "m5", "zed"]
+
+    lt_a = find(%{"_id" => %{"$lt" => "a"}})
+    assert lt_a == all_docs(%{:endkey => "\"a\"", :inclusive_end => false})
+    assert lt_a == ["B0", "Z1"]
+
+    assert find(%{"_id" => %{"$gt" => "B0", "$lte" => "b9"}}) == ["Z1", "a1", "b9"]
+  end
+
+  test "_id range in _changes selector" do
+    resp =
+      Couch.post("/#{@db_name}/_changes?filter=_selector",
+        body: %{"selector" => %{"_id" => %{"$gte" => "Z"}}},
+        headers: ["Content-Type": "application/json"]
+      )
+
+    assert resp.status_code == 200
+
+    ids = Enum.sort(Enum.map(resp.body["results"], fn row -> row["id"] end))
+    assert ids == ["Z1", "a1", "b9", "m5", "zed"]
+  end
+
+  test "icu collation for nested _id fields" do
+    # a._id instead of the top level _id
+    assert find(%{"a._id" => %{"$gte" => "Z"}}) == ["Z1", "zed"]
+  end
+end


(couchdb) 02/02: Disable PPC64LE CI run

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

nickva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d84f6e32597ccd812ba3c33ad2083baebe091263
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Tue Sep 22 13:19:06 2026 -0400

    Disable PPC64LE CI run
    
    The worker disconnected and is not reacheable by SSH. If it comes back soon
    we'll re-enable it, if it's gone for a while we'll just remove support for
    PPC64LE.
---
 build-aux/Jenkinsfile | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/build-aux/Jenkinsfile b/build-aux/Jenkinsfile
index ce6b9c11c..39c04548b 100644
--- a/build-aux/Jenkinsfile
+++ b/build-aux/Jenkinsfile
@@ -117,16 +117,19 @@ meta = [
   // other arch CI jobs and they still time out often and fail. Disable for
   // now. That's why we have the ppc64le_own label and not ppc64le.
   //
-  'base-ppc64': [
-    name: 'Debian POWER',
-    spidermonkey_vsn: '128',
-    with_nouveau: true,
-    with_clouseau: true,
-    quickjs_test262: true,
-    image: "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}",
-    node_label: 'ppc64le_own',
-    gnu_make_eunit_opts: "${DEFAULT_GNU_MAKE_EUNIT_OPTS}"
-  ],
+  // As of 2026-09-22 the worker stopped responding and is not reachable
+  // via ssh. We'll just disable it for now. If it comes back we'll re-enable it
+  // if it's gone for good, we'll just remove support for PPC64LE
+  // 'base-ppc64': [
+  //   name: 'Debian POWER',
+  //   spidermonkey_vsn: '128',
+  //   with_nouveau: true,
+  //   with_clouseau: true,
+  //   quickjs_test262: true,
+  //   image: "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}",
+  //   node_label: 'ppc64le_own',
+  //   gnu_make_eunit_opts: "${DEFAULT_GNU_MAKE_EUNIT_OPTS}"
+  // ],
 
   // Just like in the ppc64le case we sometimes "pick up" built-in s390x
   // workers added to our jenkins, but since those are managed by us, our