orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

During Large Export: Canceling Causes Issues

Open thecyman opened this issue 11 years ago • 3 comments

How to reproduce:

  • begin exporting a large (10GB+) DB with command in the console: export database /db-export/ouser-dec-13.export -includeClass OUser
  • Cancel it in the middle.
  • Try connecting to OrientDB via console.
  • Cannot connect. It says "timer already canceled":
orientdb> connect remote:localhost/someDB root XXXX
Connecting to database [remote:localhost/someDB] with user 'root'...
Error: com.orientechnologies.orient.core.exception.ODatabaseException: Error on opening database 'plocal:/odbdisk/orientdb-community-2.0-SNAPSHOT/databases/someDB'

Error: java.lang.IllegalStateException: Timer already cancelled.

Full export text

orientdb {db=pumpup}> export database /db-export/ouser-dec-13.export -includeClass OUser
Exporting current database to: database /db-export/ouser-dec-13.export -includeClass OUser in GZipped JSON format ...

2014-12-14 02:16:57:707 WARNING Unrecognized option -includeClass, skipped [ODatabaseExport]
2014-12-14 02:16:57:708 WARNING Unrecognized option OUser, skipped [ODatabaseExport]
Started export of database 'pumpup' to /db-export/ouser-dec-13.export.gz...
Exporting database info...OK
Exporting clusters...OK (72 clusters)
Exporting schema...OK (72 classes)
Exporting records...
- Cluster 'internal' (id=0)...OK (records=3/3)
- Cluster 'index' (id=1)..............OK (records=68/68)
- Cluster 'manindex' (id=2)...OK (records=1/1)
- Cluster 'default' (id=3)...OK (records=0/0)
- Cluster 'orole' (id=4)...OK (records=4/4)
- Cluster 'ouser' (id=5).............OK (records=2133385/2133385)
- Cluster 'ofunction' (id=6)...OK (records=0/0)
- Cluster 'oschedule' (id=7)...OK (records=0/0)
- Cluster 'orids' (id=8)...OK (records=0/0)
- Cluster 'v' (id=9)...OK (records=0/0)
- Cluster 'e' (id=10)...OK (records=0/0)
<SNIP>
- Cluster 'comment' (id=12)...OK (records=0/0)
<I HIT CTRL+C>
...........Error on fetching record during browsing. The record has been skipped
com.orientechnologies.orient.core.exception.ODatabaseException: Database 'remote:localhost/pumpup' is closed
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.checkOpeness(ODatabaseDocumentTx.java:2483)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.getMetadata(ODatabaseDocumentTx.java:647)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRecord(ODatabaseDocumentTx.java:1545)
    at com.orientechnologies.orient.core.tx.OTransactionNoTx.loadRecord(OTransactionNoTx.java:79)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:1379)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:124)
    at com.orientechnologies.orient.core.iterator.OIdentifiableIterator.readCurrentRecord(OIdentifiableIterator.java:278)
    at com.orientechnologies.orient.core.iterator.ORecordIteratorCluster.hasNext(ORecordIteratorCluster.java:132)
    at com.orientechnologies.orient.core.db.tool.ODatabaseExport.exportRecords(ODatabaseExport.java:173)
    at com.orientechnologies.orient.core.db.tool.ODatabaseExport.exportDatabase(ODatabaseExport.java:115)
    at com.orientechnologies.orient.console.OConsoleDatabaseApp.exportDatabase(OConsoleDatabaseApp.java:1635)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:381)
    at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:246)
    at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:135)
    at com.orientechnologies.orient.graph.console.OGremlinConsole.main(OGremlinConsole.java:62)

thecyman avatar Dec 14 '14 03:12 thecyman

Use the = between -includeClass and OUser. I suggest you to use also cluster:

-excludeAll -includeRecords=true -includeClass=OUser -includeCluster=OUser

lvca avatar Dec 14 '14 11:12 lvca

Luca, does the status of issue means that problem will not (don't have to) be fixed.

What I want to say - it is clearly syntax problem, but if whatever command or action sequence (syntax wrong or simply unaware) could ruin the server - then I suppose it should be counted as a bug.

To explain it further - for few weeks now we have everyday crash of the server with the very same phrase in logs: 2014-12-12 13:32:13:458 SEVERE Internal server error: java.lang.IllegalStateException: Timer already cancelled. [ONetworkProtocolHttpDb]

The worst thing is that I can't find any pattern to reason. Although, I know now that most of the time it happens after intensive operations, like huge uncommitted transaction or automatic backups, sometimes preceding with java.lang.OutOfMemoryError: GC overhead limit exceeded, but often just randomly - I can't catch it (I don't believe in randomness as the respective cause) and report.

You could imagine how eager I'm to find one day, that someone's request could explain and fix those problems.

a-unite avatar Dec 14 '14 15:12 a-unite

@africa-unite Yesterday I pushed a fix for this problem. Please could you update your version and let me know if happens again?

lvca avatar Dec 15 '14 16:12 lvca