Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current database instance is not active on current thread #5843

Closed
vlnj opened this issue Mar 17, 2016 · 15 comments
Closed

Current database instance is not active on current thread #5843

vlnj opened this issue Mar 17, 2016 · 15 comments
Assignees
Milestone

Comments

@vlnj
Copy link

vlnj commented Mar 17, 2016

This issue occurred when executing multiple threads to get orient database connection from database pool and process them simultaneously. when processing two threads, in some point we faced following issue. (Orient db version 2.1.12)

java.lang.IllegalStateException: Current database instance (com.orientechnologies.orient.core.db.OPartitionedDatabasePool$DatabaseDocumentTxPolled@5791a654) is not active on current thread (Thread[MyScheduler_Worker-2,5,main]). Current active database is: com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx@6f4c3d00

@andrii0lomakin
Copy link
Member

Hi, could you show us the code which you use for this task ?

@andrii0lomakin
Copy link
Member

Aslo is it possible to get stack trace with line numbers ?

@vlnj
Copy link
Author

vlnj commented Mar 17, 2016

Hi we are not authorized to share the code base. so we will create a sample code base and share it with you

Thank you

@andrii0lomakin
Copy link
Member

Sure,does not matter, I need test to reproduce it.

@andrii0lomakin
Copy link
Member

HI, any updates ?

@vlnj
Copy link
Author

vlnj commented Mar 25, 2016

Hi sorry for the delay.

We found the issue, in the middle of our process we invoke orientdb etl. after completing the etl process the problem occurs. so after completing the etl process we had to activate the db instance on current thread.

@andrii0lomakin
Copy link
Member

OK I will move, this issue to ETL team

@robfrank
Copy link
Contributor

As far as I understand, you invoke ETL programmatically form java code, am I right? Then, after ETL invocation, you have to re-activate the db instance on current thread. Are you using ETL's parallel execution? Can you share the snippet of code where you use the ETL?

@robfrank
Copy link
Contributor

no response for a while. Feel free to reopen issue if necessary

@robfrank robfrank modified the milestones: 2.1.x (next hotfix), 2.1.25 Nov 2, 2016
@shashankupadhye
Copy link

Hi Team,
we are facing a similar scenario in our poc on Orient db. Can you please help us out.

We are trying to import a CSV as an edge using ETL. The CSV has ZipCode and Complain Id as its columns. The total records in the files are close to 650,000

All the other vertices and edges have been already created barring this edge which is loading at the rate to 1/2 vertices per second.

and in between this painfully slow load, we get this intermittent error.

below is out script. Can you please help us out on this?

{
"source": { "file": { "path": "/home/cts429406/Complaint/has_ZipCode.csv" } },
"extractor": { "csv": { } },
"transformers": [
{ "merge": { "joinFieldName": "Complaint_ID", "lookup": "Complaint.Complaint_Id" } },

{"edge": { "class": "has_ZipCode",
            "joinFieldName": "ZIP_code",
            "lookup": "Zip.ZIP_code",
            "direction": "out"
			
        }
    }

],
"loader": {
"orientdb": {
"dbURL": "plocal:/home/cts429406/orientdb-community-2.2.11/databases/Test_29",
"dbType": "graph",

   "classes": [
     {"name": "Complaint", "extends": "V"},
     {"name": "Company", "extends": "V"},
	 {"name": "Issue", "extends": "V"},
	 {"name": "Product", "extends": "V"},
     {"name": "SubIssue", "extends": "V"},
	 {"name": "SubProduct", "extends": "V"},
	 {"name": "Complaint_Detail", "extends": "V"},
	 {"name": "State", "extends": "V"},
     {"name": "Zip", "extends": "V"},
	 {"name": "SubProduct", "extends": "V"},
     {"name": "Has_Product", "extends": "E"},
     {"name": "Issue_belongs_to_Product", "extends": "E"},
	 {"name": "belongs_to_Product", "extends": "E"},
     {"name": "belongs_to_Issue", "extends": "E"},
	 {"name": "Has_Detail", "extends": "E"},
	 {"name": "has_ZipCode", "extends": "E"},
	 {"name": "for_Sub_product", "extends": "E"},
	 {"name": "for_subIssue", "extends": "E"},
	 {"name": "belongs_to", "extends": "E"},
     {"name": "For_Product", "extends": "E"}
   ]
}

Sample CSV file is as follows:

Complaint_ID,ZIP_code
468882,24540
468889,95992
468879,10065
468949,30084
475823,6106
468981,75025
467801,20147
475728,32818
469026,45247
469035,89511
469037,27949
469284,90703
480488,95821
468904,19145
468905,19145
469057,14092
469060,33426
469070,10019
472236,7604

There are some cases of null records as well as null rows.

The sample log entries while runing the aboev script is as follows:

[cts429406@aster2 bin]$ ./oetl.sh has_ZipCode.json
OrientDB etl v.2.2.11 (build 2.2.x@r8b3a478e3ca7321a48e7cf0f5991569bbe06ed89; 2016-10-03 09:39:41+0000) www.orientdb.com
BEGIN ETL PROCESSOR
[file] INFO Reading from file /home/cts429406/Complaint/has_ZipCode.csv with encoding UTF-8
Started execution with 1 worker threads

  • extracted 502 rows (0 rows/sec) - 502 rows -> loaded 0 vertices (0 vertices/sec) Total time: 1000ms [0 warnings, 0 errors]
  • extracted 503 rows (1 rows/sec) - 503 rows -> loaded 1 vertices (1 vertices/sec) Total time: 2s [0 warnings, 0 errors]
  • extracted 504 rows (1 rows/sec) - 504 rows -> loaded 2 vertices (1 vertices/sec) Total time: 3s [0 warnings, 0 errors]
  • extracted 505 rows (1 rows/sec) - 505 rows -> loaded 3 vertices (1 vertices/sec) Total time: 4s [0 warnings, 0 errors]
  • extracted 506 rows (1 rows/sec) - 506 rows -> loaded 4 vertices (1 vertices/sec) Total time: 5s [0 warnings, 0 errors]
    $ANSI{green {db=Test_29}} Error on updating record Schema is not refreshed [moved] #85:0 (cluster: plocal cluster: complaint_4)
    java.lang.NullPointerException
    at com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerShared.loadTree(OSBTreeCollectionManagerShared.java:106)
    at com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.loadSBTree(OSBTreeCollectionManagerAbstract.java:109)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.ORidBagUpdateSerializationOperation.loadTree(ORidBagUpdateSerializationOperation.java:76)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.ORidBagUpdateSerializationOperation.execute(ORidBagUpdateSerializationOperation.java:57)
    at com.orientechnologies.orient.core.storage.impl.local.paginated.ORecordSerializationContext.executeOperations(ORecordSerializationContext.java:90)
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doUpdateRecord(OAbstractPaginatedStorage.java:3166)
    at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.updateRecord(OAbstractPaginatedStorage.java:1117)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:2082)
    at com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:189)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2579)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:103)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1802)
    at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:1793)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.addEdgeInternal(OrientGraphNoTx.java:249)
    at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.addEdgeInternal(OrientGraphNoTx.java:137)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.addEdge(OrientVertex.java:717)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.addEdge(OrientVertex.java:656)
    at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.createEdge(OEdgeTransformer.java:201)
    at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.executeTransform(OEdgeTransformer.java:123)
    at com.orientechnologies.orient.etl.transformer.OAbstractTransformer.transform(OAbstractTransformer.java:37)
    at com.orientechnologies.orient.etl.OETLPipeline.execute(OETLPipeline.java:110)
    at com.orientechnologies.orient.etl.OETLProcessor$OETLPipelineWorker.call(OETLProcessor.java:584)
    at com.orientechnologies.orient.etl.OETLProcessor$OETLPipelineWorker.call(OETLProcessor.java:566)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    $ANSI{green {db=Test_29}} Error on updating record Schema is not refreshed [moved] #85:0 (cluster: plocal cluster: complaint_4)

Any help is appreciated.. Thanks in advance:)

@andrii0lomakin
Copy link
Member

@saeedtabrizi this problem should be fixed on latest 2.2.x version did you try your case on this version ?

@shashankupadhye
Copy link

Hi Saeed,
Thanks for your reply. We are currently working on Orient Db Community version 2.2.11. Below are the exact details of the version. This is what we get when we bring up the server. Please let me know in case you need any other information.

INFO OrientDB Server is active v2.2.11 (build 2.2.x@r8b3a478e3ca7321a48e7cf0f5991569bbe06ed89;

@saeedtabrizi
Copy link
Contributor

Hi @Laa , @shashankupadhye
I guess the mention is not for mine . I have no similar issue in there .

@taburet
Copy link
Contributor

taburet commented Dec 20, 2016

@shashankupadhye Hi! Could you please share the database directory file listing including file sizes after the NPE happened.

@shashankupadhye
Copy link

Hi taburet,
The issue was resolved after indexing the vertices. Thanks everyone for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

7 participants