Open vintzl opened 5 years ago
I also identified this behavior while testing with
This IOException respective search timeout occurred since I began to use default_security=everyone
of CouchDB 3 respective made my databases public (no role _admin for admins and members anymore). This error is for me re-producible by just change the permissions of a database I want to query afterwards.
Example: set admin roles to ["_admin"] and afterwards again to [].
After some debugging of the code of CouchDB-Lucene it became apparent that the root of this timeout seems to be the change sequences of CouchDB. In the DatabaseIndexer in the private method blockForLatest (which is run only if stale != "ok"), there is the comparison between database.getLastSequence() and pending_seq. The method is looping in the while (pending_seq.isEarlierThan(latest)
statement until it times out.
Long story short: these values differ. The change sequences of CouchDB behave wrongly and therefore every subsequent search query will timeout.
I have currently a quick fix for that (and I am not happy with it):
Maybe that helps you at least @vintzl. The reason why it worked with "stale=ok" is that it does not enter the while loop. However, the change sequences are still broke and you don't get a result set. However, I am hoping for CouchDB 4 and the new security concept, v3 seems to be an intermediate step introducing new security features..
Maybe you can find a solution for that behavior. I cannot say if it's a general issue of CouchDB or CouchDB-Lucene.
Why I get this:
with this index (formatted here for readability):
And if i try with
&stale=ok
the result is empty: