nickva commented on PR #5628:
URL: https://github.com/apache/couchdb/pull/5628#issuecomment-3301372396

   I gave this a try with this test script. Without adding an explicit 
`"lucene_version"` it worked.
   
   ```shell
   #!/bin/bash
   
   set -x
   
   http -b post $DB/_nouveau_analyze analyzer=standard text=for@bar@baz
   
   http -q delete $DB/ndb
   http -q put $DB/ndb
   
   http -q post $DB/ndb/_bulk_docs 
docs:='[{"_id":"1","a":"xxx"},{"_id":"2","a":"xxx"},{"_id":"3","a":"zzz"},{"_id":"4","a":"xxx"}]'
   
   http -b put $DB/ndb/_design/nd1 nouveau:='{"idx1": 
{"index":"function(doc){index(\"string\",\"a\",doc.a,{\"store\":true})}"}}'
   http -b post $DB/ndb/_design/nd1/_nouveau/idx1 q="a:xxx" limit:='2'
   ```
   
   
    * I then added an explicit `"lucene_version":9` and got an error:
   ```shell
   #!/bin/bash
   
   set -x
   
   http -b post $DB/_nouveau_analyze analyzer=standard text=for@bar@baz
   
   http -q delete $DB/ndb
   http -q put $DB/ndb
   
   http -q post $DB/ndb/_bulk_docs 
docs:='[{"_id":"1","a":"xxx"},{"_id":"2","a":"xxx"},{"_id":"3","a":"zzz"},{"_id":"4","a":"xxx"}]'
   
   # http -b put $DB/ndb/_design/nd1 nouveau:='{"idx1": 
{"index":"function(doc){index(\"string\",\"a\",doc.a,{\"store\":true})}"}}'
   # http -b post $DB/ndb/_design/nd1/_nouveau/idx1 q="a:xxx" limit:='2'
   
   http -b put $DB/ndb/_design/nd2 nouveau:='{"idx": {"lucene_version":9, 
"index":"function(doc){index(\"string\",\"a\",doc.a,{\"store\":true})}"}}'
   http -b post $DB/ndb/_design/nd2/_nouveau/idx q="a:xxx" limit:='2'
   
   ```
   
   ```
   + http -b post http://adm:[email protected]:15984/ndb/_design/nd2/_nouveau/idx 
q=a:xxx limit:=2
   {
       "error": "internal_server_error",
       "reason": "There was an error processing your request. It has been 
logged (ID add3f84dfaa436f8)."
   }
   ```
   
   ```
   e955c5ee6b50659cc9f3a4717962e028201fa2d/index/9 
lockFactory=org.apache.lucene.store.NativeFSLockFactory@4d6b0c30)): files: 
[write.lock]
   ! at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1085)
   ! at org.apache.couchdb.nouveau.core.IndexManager.load(IndexManager.java:408)
   ! at org.apache.couchdb.nouveau.core.IndexManager.with(IndexManager.java:140)
   ! at 
org.apache.couchdb.nouveau.resources.IndexResource.getIndexInfo(IndexResource.java:85)
   ! at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
   ! at java.base/java.lang.reflect.Method.invoke(Method.java:580)
   ! at 
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
   ! at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
   ! at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
   ! at 
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
   ! at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
   ! at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
   ! at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
   ! at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
   ! at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256)
   ! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
   ! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
   ! at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
   ! at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
   ! at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
   127.0.0.1 - - [17/Sep/2025:05:20:17 +0000] "GET 
/index/node1%40127.0.0.1%2Fshards%2F00000000-7fffffff%2Fndb.1758086356%2Ffa5d962fee656da8f55e1e9d8e955c5ee6b50659cc9f3a4717962e028201fa2d
 HTTP/2.0" 500 110 "-" "-" 6
   ! at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
   ! at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235)
   ! at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
   ! at 
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:397)
   ! at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:349)
   ! at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:379)
   ! at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
   ! at 
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
   ! at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
   ! at 
org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
   ! at 
io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:36)
   ! at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
   ! at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
   ! at 
io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:46)
   ! at 
io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:40)
   ! at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
   ! at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
   ! at 
org.apache.couchdb.nouveau.core.UserAgentFilter.doFilter(UserAgentFilter.java:45)
   ! at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
   ! at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
   ! at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
   ! at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
   ! at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1381)
   ! at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
   ! at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
   ! at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
   ! at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1303)
   ! at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
   ! at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
   ! at 
io.dropwizard.metrics.jetty11.InstrumentedHandler.handle(InstrumentedHandler.java:313)
   ! at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:52)
   ! at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
   ! at 
org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822)
   ! at 
io.dropwizard.jetty.ZipExceptionHandlingGzipHandler.handle(ZipExceptionHandlingGzipHandler.java:26)
   ! at 
org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:46)
   ! at 
org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:173)
   ! at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
   ! at org.eclipse.jetty.server.Server.handle(Server.java:563)
   ! at 
org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
   ! at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
   ! at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
   ! at org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:461)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:193)
   ! at 
org.eclipse.jetty.http2.HTTP2Connection.produce(HTTP2Connection.java:208)
   ! at 
org.eclipse.jetty.http2.HTTP2Connection.onFillable(HTTP2Connection.java:155)
   ! at 
org.eclipse.jetty.http2.HTTP2Connection$FillableCallback.succeeded(HTTP2Connection.java:450)
   ! at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
   ! at 
org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
   ! at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)
   ! at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
   ! at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
   ! at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
   ! at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
   ! at java.base/java.lang.Thread.run(Thread.java:1583)
   ```
    * An explicit  `"lucene_version":10` worked
   
    * `"lucene_version":11` worked, validation error `"luceneVersion must be 
less than or equal to 10"`
   
    * `"lucene_version":"foo"` => 500 error:
    
   ```
   + http -b post http://adm:[email protected]:15984/ndb/_design/nd2/_nouveau/idx 
q=a:xxx limit:=2
   {
       "error": "bad_request",
       "reason": "Unable to process JSON"
   }
   ```
   
   ```
   WARN  [2025-09-17 05:32:18,842] 
org.apache.couchdb.nouveau.core.IndexManager: I/O exception while committing 
[email protected]/shards/00000000-7fffffff/ndb.1758086897/b72b474eb35832d8bbe31c0798cec599c585c164b52b4ca880b59bfe87eb0f2c
   ! java.nio.file.NoSuchFileException: 
/Users/nvatama/asf-3/dev/lib/nouveau/[email protected]/shards/00000000-7fffffff/ndb.1758086897/b72b474eb35832d8bbe31c0798cec599c585c164b52b4ca880b59bfe87eb0f2c/index/10/write.lock
   ! at 
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
   ! at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
   ! at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
   ! at 
java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
   ! at 
java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:171)
   ! at java.base/java.nio.file.Files.readAttributes(Files.java:1854)
   ! at 
org.apache.lucene.store.NativeFSLockFactory$NativeFSLock.ensureValid(NativeFSLockFactory.java:177)
   ! at 
org.apache.lucene.store.LockValidatingDirectoryWrapper.syncMetaData(LockValidatingDirectoryWrapper.java:61)
   ! at 
org.apache.lucene.index.SegmentInfos.prepareCommit(SegmentInfos.java:906)
   ! at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:5671)
   ! at 
org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3813)
   ! at 
org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:4154)
   ! at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:4116)
   ! at 
org.apache.couchdb.nouveau.lucene.LuceneIndex.doCommit(LuceneIndex.java:170)
   ! at org.apache.couchdb.nouveau.core.Index.commit(Index.java:96)
   ! at 
org.apache.couchdb.nouveau.core.IndexManager.lambda$commitFun$4(IndexManager.java:347)
   ! at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
   ! at 
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
   ! at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
   ! at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   ! at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   ! at 
com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66)
   ! at java.base/java.lang.Thread.run(Thread.java:1583)
   ```


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