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

   ### Version
   
   3.5.2
   
   ### Describe the problem you're encountering
   
   We are doing quite extensive purging (through the `_purge`endpoint), we are 
also using Nouveau indexes. 
   
   In one instance, Nouveau index queries started failing consistently. This is 
the error we saw in CouchDb logs: 
   
   ```
   {{case_clause,{error,{conflict,<<"Index updates applied in the wrong order 
(current seq: 7439245, match seq: 7439245, attempted seq: 
7438959)">>}}},[{couch_btree,stream_kv_node2,9,[{file,"src/couch_btree.erl"},{line,1315}]},{couch_btree,stream_kp_node,8,[{file,"src/couch_btree.erl"},{line,1241}]},{couch_btree,stream_kp_node,9,[{file,"src/couch_btree.erl"},{line,1286}]},{couch_btree,fold,4,[{file,"src/couch_btree.erl"},{line,283}]},{couch_bt_engine,fold_purge_infos,5,[{file,"src/couch_bt_engine.erl"},{line,607}]},{nouveau_index_updater,purge_index,3,[{file,"src/nouveau_index_updater.erl"},{line,288}]},{nouveau_index_updater,update,1,[{file,"src/nouveau_index_updater.erl"},{line,97}]}]}
   [error] 2026-09-17T18:45:51.685469Z [email protected] <0.2024.0> -------- 
nouveau_index_manager: db:**** ddoc:**** failed with: 
{{case_clause,{error,{conflict,<<"Index updates applied in the wrong order 
(current seq: 7420581, match seq: 7420581, attempted seq: 
7420405)">>}}},[{couch_btree,stream_kv_node2,9,[{file,"src/couch_btree.erl"},{line,1315}]},{couch_btree,stream_kp_node,8,[{file,"src/couch_btree.erl"},{line,1241}]},{couch_btree,stream_kp_node,9,[{file,"src/couch_btree.erl"},{line,1286}]},{couch_btree,fold,4,[{file,"src/couch_btree.erl"},{line,283}]},{couch_bt_engine,fold_purge_infos,5,[{file,"src/couch_bt_engine.erl"},{line,607}]},{nouveau_index_updater,purge_index,3,[{file,"src/nouveau_index_updater.erl"},{line,288}]},{nouveau_index_updater,update,1,[{file,"src/nouveau_index_updater.erl"},{line,97}]}]}
   [error] 2026-09-17T18:45:51.685586Z [email protected] emulator -------- 
Error in process <0.111495.0> on node '[email protected]' with exit value:
   ```
   
   The team deleted the affected reported nouveau index on disk, expecting the 
index rebuild to resolve the error. Instead, this is the error that is logged 
now: 
   
   ```
   
{{invalid_start_purge_seq,0,180213},[{couch_bt_engine,fold_purge_infos,5,[{file,"src/couch_bt_engine.erl"},{line,601}]},{nouveau_index_updater,purge_index,3,[{file,"src/nouveau_index_updater.erl"},{line,288}]},{nouveau_index_updater,update,1,[{file,"src/nouveau_index_updater.erl"},{line,97}]}]}
   ```
   
   The Nouveau container is not reporting any errors. 
   
   
   ### Expected Behaviour
   
   Using _purge should preserve Nouveau indexes. 
   
   ### Steps to Reproduce
   
   Repeatedly calling the `_purge` over a database that uses Nouveau indexes. 
   This only appeared on one instance and we were unable to replicate it in 
tests. It seems that a race condition is causing this. 
   
   ### Your Environment
   
   Docker hosted CouchDb + Nouveau 3.5.2. 
   
   ### Additional Context
   
   Can you please advise on steps to unblock this instance. Deleting one 
Nouveau index did not resolve this, but did change the error that was being 
thrown. 
   


-- 
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