dianabarsan opened a new issue, #6128:
URL: https://github.com/apache/couchdb/issues/6128

   ### 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, purges 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_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to