Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: Ghost view rows persisting after their corresponding docs have been purged

Chiusa
#6,128 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
40/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
erlang, javascript
Ambito
backend, databases

Direzione di ricerca

The issue includes a detailed reproduction script. Start by running the script to confirm the ghost rows. Examine the view indexing logic in the CouchDB source, likely in the view server or indexer modules. Look for how purges interact with view updates. The goal is to understand why rows persist after purges and ensure they are cleaned up during normal operations.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Version

3.5.2

Describe the problem you're encountering

I am seeing view row ghosts when I purge large amounts of documents, while querying the view in between purge batches. These ghost rows return doc: null when queried with include_docs=true, and they never go away, they survive new docs being pushed and compaction. Only a full index rebuild seems to remove them.
The view reports that it caught up with the purges.

Expected Behaviour

I would expect the view to never return rows with no docs, or at least to heal after some point.

Steps to Reproduce

Repro script available here: https://gist.github.com/dianabarsan/5e21753d6545e6f61429ed31ebe79714

  • create throwaway db
  • create one design doc and one view that would index every doc
  • seed db with 300k documents
  • with a batch size of 1000, purge all documents, querying the view after each batch
  • after all docs are purged, query the view and inspect the results

Sample result:

CouchDb 3.5.2, 300000 docs, purging 1000 at a time, querying view after each batch

attempt 1:     543 ghost view rows

db doc_count   0
db purge_seq   300000-g1AAAAIdeJx90C0OwkAQBeAJIDEILoEgFIOEGxBo5wD9Ec2mgYQEjeIIlVhoh-BxgOAACDgEZ6BdZqd-dsUT871NZjMA6KbtBHrxehunSTTzxpPhiK-X8ai16sCJ6Mth-ZgIIHzqfIn45jhyS_he55W1N44Ft4RvdF4QEcePW8LnOvcR82YFEn5ReLSztm4WyAXfNWyISteohL40ioiB84XQq0an_MnO-0LPGh3wTs7XQg8a7fOLzpdCPwoNweFA3MP8AXUdop0
view purge_seq 300000
view query result:
{
  total_rows: 543,
  offset: 0,
  rows: [
    { id: 'd32020', key: 'd32020', value: null, doc: null },
    { id: 'd32024', key: 'd32024', value: null, doc: null },
    { id: 'd32028', key: 'd32028', value: null, doc: null },
    { id: 'd32034', key: 'd32034', value: null, doc: null },
    { id: 'd32069', key: 'd32069', value: null, doc: null },
    { id: 'd32071', key: 'd32071', value: null, doc: null },
    { id: 'd32075', key: 'd32075', value: null, doc: null },
    { id: 'd32079', key: 'd32079', value: null, doc: null },
    { id: 'd32092', key: 'd32092', value: null, doc: null },
    { id: 'd32096', key: 'd32096', value: null, doc: null },
    ... 533 more items
  ]
}

What I see in Fauxton:

https://github.com/user-attachments/assets/caec4929-ebe1-4910-bc5b-d566e31ad6a4

Your Environment

Manjaro Linux, CouchDb 5.3.2 in Docker

Additional Context

No response

Lingua principale
Erlang
Stelle
7k
Fork
1.1k
Merge medio
10h 25m
PR unite (30g)
35

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/couchdb

Tutte le issue di apache/couchdb

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.