Error while running optimize


(Hmottestad) #1

Hi,

I got an error while trying to run optimize on stardog 5.1.0.

This was from a disk based copy of the production database which was copied by putting the stardog database offline, copying over the entire directory and then putting the databse back online.

ERROR 2018-07-06 12:10:16,854 [XNIO-1 task-3] com.stardog.http.server.undertow.ErrorHandling:writeError(180): Unexpected error on the server
com.complexible.stardog.db.DatabaseException: There was an error while attempting to optimize the database testSesame.
	at com.complexible.stardog.db.DatabaseImpl.optimize(DatabaseImpl.java:926) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.StardogKernel.optimize(StardogKernel.java:2220) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.protocols.http.server.AdminDatabaseService.optimize(AdminDatabaseService.java:233) ~[stardog-protocols-http-server-5.1.0.jar:?]
	at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-5.1.0.jar:?]
	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
	at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$1(ErrorHandling.java:71) ~[stardog-protocols-http-server-5.1.0.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111-internal]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111-internal]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111-internal]
Caused by: com.complexible.stardog.db.DatabaseException: Invalid state:  [DISPOSED]
	at com.complexible.stardog.db.DatabaseImpl.optimize(DatabaseImpl.java:922) ~[stardog-5.1.0.jar:?]
	... 9 more
Caused by: java.lang.IllegalStateException: Invalid state:  [DISPOSED]
	at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:?]
	at com.complexible.stardog.index.disk.btree.impl.BPlusTreeImpl.size(BPlusTreeImpl.java:276) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.index.AggregateContextIndex.getSingleContext(AggregateContextIndex.java:129) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.index.ContextIndex.hasSingleContext(ContextIndex.java:26) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.index.AbstractIndex.clearPlanCacheIfNecessary(AbstractIndex.java:305) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.index.AbstractIndex.commit(AbstractIndex.java:295) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.index.AbstractIndex.optimize(AbstractIndex.java:453) ~[stardog-5.1.0.jar:?]
	at com.complexible.stardog.db.index.ConnectableIndex.optimize(ConnectableIndex.java:135) ~[stardog-5.1.0.jar:?]
	at com.complexible.common.base.Streams.lambda$uncheckedConsumer$4(Streams.java:185) ~[stardog-utils-common-5.1.0.jar:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_111-internal]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_111-internal]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_111-internal]
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:1.8.0_111-internal]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_111-internal]
	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) ~[?:1.8.0_111-internal]
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) ~[?:1.8.0_111-internal]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_111-internal]
	at java.util.concurrent.ForkJoinPool.helpComplete(ForkJoinPool.java:1870) ~[?:1.8.0_111-internal]
	at java.util.concurrent.ForkJoinPool.externalHelpComplete(ForkJoinPool.java:2467) ~[?:1.8.0_111-internal]
	at java.util.concurrent.ForkJoinTask.externalAwaitDone(ForkJoinTask.java:324) ~[?:1.8.0_111-internal]
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:405) ~[?:1.8.0_111-internal]
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) ~[?:1.8.0_111-internal]
	at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160) ~[?:1.8.0_111-internal]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174) ~[?:1.8.0_111-internal]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[?:1.8.0_111-internal]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_111-internal]
	at com.complexible.stardog.db.DatabaseImpl.optimize(DatabaseImpl.java:915) ~[stardog-5.1.0.jar:?]
	... 9 more

I’m going to do some tests to see if there is any data loss.

Cheers,
Håvard