Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: incorrect order when using `sort` with nouveau on multiple shards

Closed
#6,124 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
erlang, python
Domain
databases, search

Research direction

The issue is in the Nouveau search module when sorting string fields across shards. Start by examining the Python reproducer script to understand the test setup. Look at the CouchDB source code for the Nouveau search implementation, focusing on sorting logic and shard merging. Running the reproducer against a local CouchDB instance will verify the bug. 'Done' means the sort order is correct across shards in the test.

Written by the indexing model from the issue text.

Description

bug needs-triage
Version

3.5.2

Describe the problem you're encountering

Dear CouchDB team,

It seems that there is a doc ordering issue in the following context:

  • using Nouveau search
  • with sort on a string field
  • with matching documents located on different shards

You can then end up with results such as ["apple", "Zebra", "apple"]

Expected Behaviour

I would expect sorting to work for documents across shards.

Steps to Reproduce

Here is a minimal reproducer, created by @AlexanderKaraberov
nouveau_min_repro.py

Your Environment

I was able to reproduce the issue on CouchDB 3.5.0 and 3.5.2. It can be reproduced with the docker image apache/couchdb:3.5.0.

Additional Context

No response

Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
5h 24m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/couchdb

All issues in apache/couchdb

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.