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

NPE creating index entry #5907

Closed
zerovian opened this issue Mar 30, 2016 · 37 comments
Closed

NPE creating index entry #5907

zerovian opened this issue Mar 30, 2016 · 37 comments
Assignees
Labels
Milestone

Comments

@zerovian
Copy link

orientdb 2.1.11

Unfortunately I don't have a reproducable for this. It takes 2-3 days for it to occur and it is somewhat random, but it eventually always occurs.

I suspect there might be another exception underneath this (possibly an OOM), but since the releaseExclusiveLock() is in the finally block and it is throwing NPE, the original exception is lost.

Looking at OCacheEntry I don't see why the dataPointer would be going null between the call to acquireExclusiveLock and releaseExclusiveLock.

com.progress.isq.ipqos.WorkErrorException: Error during insertion of key in index
at com.progress.isq.ipqos.resources.plugins.openedge.work.WorkRunnable.performPolling(WorkRunnable.java:64)
at com.progress.isq.ipqos.resources.plugins.openedge.work.DatabaseInstWork.doWork(DatabaseInstWork.java:85)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseInstResource.doWork(DatabaseInstResource.java:526)
at com.progress.isq.ipqos.ScheduledWorkShell.run(ScheduledWorkShell.java:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.orientechnologies.orient.core.index.OIndexException: Error during insertion of key in index
at com.orientechnologies.orient.core.index.OIndexMultiValues.put(OIndexMultiValues.java:162)
at com.orientechnologies.orient.core.index.OIndexMultiValues.put(OIndexMultiValues.java:52)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.addIndexEntry(OTransactionNoTx.java:256)
at com.orientechnologies.orient.core.index.OIndexTxAware.put(OIndexTxAware.java:97)
at com.orientechnologies.orient.core.index.OIndexTxAware.put(OIndexTxAware.java:41)
at com.orientechnologies.orient.core.index.OClassIndexManager.addIndexEntry(OClassIndexManager.java:530)
at com.orientechnologies.orient.core.index.OClassIndexManager.addIndexesEntries(OClassIndexManager.java:517)
at com.orientechnologies.orient.core.index.OClassIndexManager.onRecordAfterCreate(OClassIndexManager.java:428)
at com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:229)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.callbackHooks(ODatabaseDocumentTx.java:1037)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.callbackHookSuccess(ODatabaseDocumentTx.java:3038)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeSaveRecord(ODatabaseDocumentTx.java:1987)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.saveRecord(OTransactionNoTx.java:160)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:2532)
at com.orientechnologies.orient.object.db.OObjectDatabaseTx.save(OObjectDatabaseTx.java:470)
at com.orientechnologies.orient.object.db.OObjectDatabaseTx.save(OObjectDatabaseTx.java:405)
at com.progress.isq.ipqos.activity.ActivityDataAccess.save(ActivityDataAccess.java:60)
at com.progress.isq.ipqos.activity.ActivityService.create(ActivityService.java:73)
at com.progress.isq.ipqos.activity.ActivityService.create(ActivityService.java:60)
at com.progress.isq.ipqos.activity.ServiceAdapter.storeActivities(ServiceAdapter.java:63)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processData(MultiActivityServiceAdapter.java:262)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processResponse(MultiActivityServiceAdapter.java:219)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processActivities(MultiActivityServiceAdapter.java:201)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityProcessor.processActivities(DatabaseActivityProcessor.java:431)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processActivities(MultiActivityServiceAdapter.java:181)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.fetchAndStoreActivities(MultiActivityServiceAdapter.java:111)
at com.progress.isq.ipqos.resources.plugins.openedge.work.WorkRunnable.performPolling(WorkRunnable.java:60)
... 6 more
Caused by: java.lang.NullPointerException
at com.orientechnologies.orient.core.storage.cache.OCacheEntry.releaseExclusiveLock(OCacheEntry.java:81)
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperation.commitChanges(OAtomicOperation.java:394)
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.endAtomicOperation(OAtomicOperationsManager.java:168)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commitAtomicOperation(OAbstractPaginatedStorage.java:351)
at com.orientechnologies.orient.core.index.OIndexAbstract.commitStorageAtomicOperation(OIndexAbstract.java:928)
at com.orientechnologies.orient.core.index.OIndexMultiValues.put(OIndexMultiValues.java:157)
... 32 more

@andrii0lomakin andrii0lomakin self-assigned this Mar 30, 2016
@andrii0lomakin andrii0lomakin added this to the 2.1.x (next hotfix) milestone Mar 30, 2016
@andrii0lomakin
Copy link
Member

@zerovian thank you very much we will on this at Monday.

@andrii0lomakin
Copy link
Member

@zerovian if I provide you patch with special logging is it possible for you to apply it to check root cause of this issue ? This issue supercritical for us so once you send us report we will release hotfix release in couple of days. I will really appreciate your help.

@andrii0lomakin
Copy link
Member

Well I have found reason of your issue, started to fix.

@andrii0lomakin
Copy link
Member

Well sorry, idea was wrong. Still about original question "if I provide you patch with special logging is it possible for you to apply it to check root cause of this issue ?"

@zerovian
Copy link
Author

zerovian commented Apr 4, 2016

No problem. I can replace a .jar as needed. Some caveats though. I'm stuck on 2.1.11 due to 5831, so patch would need to be against 2.1.11.

@andrii0lomakin
Copy link
Member

I see , sure I will fix your other issue and then will provide patch.

@andrii0lomakin
Copy link
Member

One more suggestion could you run your code with following settings on latest version. Probably it iwll help

            -Dstorage.makeFullCheckpointAfterClusterCreate=false
            -Ddb.makeFullCheckpointOnIndexChange=false
            -Ddb.makeFullCheckpointOnSchemaChange=false

@andrii0lomakin
Copy link
Member

@andrii0lomakin
Copy link
Member

It is 2.1.11 with logger to understand cause of NPE

@zerovian
Copy link
Author

zerovian commented Apr 4, 2016

I'll try with these and see if it fixes the performance issue (5831). If that works, then I'll grab next nightly against 2.1.15 and run our tests with that. It will take a few days to get back to you.

@zerovian
Copy link
Author

zerovian commented Apr 4, 2016

ok. i'll try with that build

@andrii0lomakin
Copy link
Member

thank you very much

@zerovian
Copy link
Author

zerovian commented Apr 7, 2016

This finally triggered yesterday evening. Normally we run with disk cache at 384. It takes longer to trigger in that case, but it eventually always happens. In this case we reduced it to 128.

storage.diskCache.bufferSize=128

AdminServer>Apr 05, 2016 5:06:56 PM com.orientechnologies.common.log.OLogManager
log
INFO: Database 'configdb' uses 111MB/128MB of DISKCACHE memory, while Heap is no
t completely used (usedHeap=150MB maxHeap=247MB). To improve performance set max
Heap to 180MB and DISKCACHE to 195MB
Apr 05, 2016 5:06:56 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx180M 2) MAXDISKCACHE=195
Apr 05, 2016 5:06:56 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'cachedb' uses 111MB/128MB of DISKCACHE memory, while Heap is not
completely used (usedHeap=150MB maxHeap=247MB). To improve performance set maxH
eap to 180MB and DISKCACHE to 195MB
Apr 05, 2016 5:06:56 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx180M 2) MAXDISKCACHE=195
Apr 05, 2016 6:47:01 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'configdb' uses 128MB/128MB of DISKCACHE memory, while Heap is no
t completely used (usedHeap=168MB maxHeap=247MB). To improve performance set max
Heap to 202MB and DISKCACHE to 172MB
Apr 05, 2016 6:47:01 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx202M 2) MAXDISKCACHE=172
Apr 05, 2016 6:47:01 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'cachedb' uses 128MB/128MB of DISKCACHE memory, while Heap is not
completely used (usedHeap=168MB maxHeap=247MB). To improve performance set maxH
eap to 202MB and DISKCACHE to 172MB
Apr 05, 2016 6:47:01 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx202M 2) MAXDISKCACHE=172
Apr 05, 2016 7:13:02 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'configdb' uses 108MB/128MB of DISKCACHE memory, while Heap is no
t completely used (usedHeap=169MB maxHeap=247MB). To improve performance set max
Heap to 203MB and DISKCACHE to 171MB
Apr 05, 2016 7:13:02 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx203M 2) MAXDISKCACHE=171
Apr 05, 2016 7:13:02 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'cachedb' uses 108MB/128MB of DISKCACHE memory, while Heap is not
completely used (usedHeap=169MB maxHeap=247MB). To improve performance set maxH
eap to 203MB and DISKCACHE to 171MB
Apr 05, 2016 7:13:02 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx203M 2) MAXDISKCACHE=171
Apr 05, 2016 8:57:06 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'configdb' uses 111MB/128MB of DISKCACHE memory, while Heap is no
t completely used (usedHeap=173MB maxHeap=247MB). To improve performance set max
Heap to 208MB and DISKCACHE to 167MB
Apr 05, 2016 8:57:06 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx208M 2) MAXDISKCACHE=167
Apr 05, 2016 8:57:06 PM com.orientechnologies.common.log.OLogManager log
INFO: Database 'cachedb' uses 111MB/128MB of DISKCACHE memory, while Heap is not
completely used (usedHeap=173MB maxHeap=247MB). To improve performance set maxH
eap to 208MB and DISKCACHE to 167MB
Apr 05, 2016 8:57:06 PM com.orientechnologies.common.log.OLogManager log
INFO: -> Open server.sh (or server.bat on Windows) and change the following vari
ables: 1) MAXHEAP=-Xmx208M 2) MAXDISKCACHE=167
Apr 06, 2016 7:32:12 PM com.orientechnologies.common.log.OLogManager log
SEVERE: {db=cachedb} Data pointer is null, nuller stack trace is:
java.lang.Thread.getStackTrace(Thread.java:1588)
com.orientechnologies.orient.core.storage.cache.OCacheEntry.clearCachePointer(OC
acheEntry.java:66)
com.orientechnologies.orient.core.storage.cache.local.O2QCache.removeColdPagesWi
thoutCacheLock(O2QCache.java:922)
com.orientechnologies.orient.core.storage.cache.local.O2QCache.removeColdestPage
sIfNeeded(O2QCache.java:831)
com.orientechnologies.orient.core.storage.cache.local.O2QCache.load(O2QCache.jav
a:333)
com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComp
onent.loadPage(ODurableComponent.java:131)
com.orientechnologies.orient.core.storage.impl.local.paginated.OPaginatedCluster
.readRecord(OPaginatedCluster.java:551)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.d
oReadRecord(OAbstractPaginatedStorage.java:2127)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.r
eadRecord(OAbstractPaginatedStorage.java:1854)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.r
eadRecord(OAbstractPaginatedStorage.java:826)
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$SimpleRecordRe
ader.readRecord(ODatabaseDocumentTx.java:3224)
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRec
ord(ODatabaseDocumentTx.java:1844)
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabase
DocumentTx.java:601)
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(ODatabase
DocumentTx.java:121)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearchRec
ord(OCommandExecutorSQLSelect.java:539)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchFromTarget(
OCommandExecutorSQLSelect.java:1481)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchValuesFromI
ndexCursor(OCommandExecutorSQLSelect.java:2115)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchForIndexes
(OCommandExecutorSQLSelect.java:1979)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInClasses(
OCommandExecutorSQLSelect.java:922)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.assig
nTarget(OCommandExecutorSQLResultsetAbstract.java:199)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCo
mmandExecutorSQLSelect.java:507)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OC
ommandExecutorSQLSelect.java:489)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommand
ExecutorSQLSelect.java:460)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OComma
ndExecutorSQLDelegate.java:90)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.e
xecuteCommand(OAbstractPaginatedStorage.java:1522)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.c
ommand(OAbstractPaginatedStorage.java:1503)
com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:72)
com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.ja
va:33)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelete.execute(OCommand
ExecutorSQLDelete.java:178)
com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OComma
ndExecutorSQLDelegate.java:90)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.e
xecuteCommand(OAbstractPaginatedStorage.java:1522)
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.c
ommand(OAbstractPaginatedStorage.java:1503)
com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OC
ommandRequestTextAbstract.java:67)
com.orientechnologies.orient.object.db.OCommandSQLPojoWrapper.execute(OCommandSQ
LPojoWrapper.java:50)
com.progress.isq.ipqos.activity.ActivityDataAccess.deleteByTime(ActivityDataAcce
ss.java:352)
com.progress.isq.ipqos.activity.ActivityService.delete(ActivityService.java:265)

com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.deleteRuleAndTrendHi
story(MultiActivityServiceAdapter.java:324)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.deleteRuleAndTrendHi
story(MultiActivityServiceAdapter.java:293)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processAndCollectDat
a(MultiActivityServiceAdapter.java:274)
com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityProcessor.proc
essAndCollectData(DatabaseActivityProcessor.java:773)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processData(MultiAct
ivityServiceAdapter.java:257)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processResponse(Mult
iActivityServiceAdapter.java:219)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processActivities(Mu
ltiActivityServiceAdapter.java:201)
com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityProcessor.proc
essActivities(DatabaseActivityProcessor.java:431)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processActivities(Mu
ltiActivityServiceAdapter.java:181)
com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.fetchAndStoreActivit
ies(MultiActivityServiceAdapter.java:111)
com.progress.isq.ipqos.resources.plugins.openedge.work.WorkRunnable.performPolli
ng(WorkRunnable.java:60)
com.progress.isq.ipqos.resources.plugins.openedge.work.DatabaseInstWork.doWork(D
atabaseInstWork.java:85)
com.progress.isq.ipqos.resources.plugins.database.DatabaseInstResource.doWork(Da
tabaseInstResource.java:524)
com.progress.isq.ipqos.ScheduledWorkShell.run(ScheduledWorkShell.java:86)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)

Apr 06, 2016 7:32:12 PM com.orientechnologies.common.log.OLogManager log
SEVERE: {db=cachedb} Error on deleting record #93:1207199( cluster: plocal clust
er: tablestat)
java.lang.NullPointerException
at com.orientechnologies.orient.core.storage.cache.OCacheEntry.releaseEx
clusiveLock(OCacheEntry.java:92)
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomic
operations.OAtomicOperation.commitChanges(OAtomicOperation.java:394)
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomic
operations.OAtomicOperationsManager.endAtomicOperation(OAtomicOperationsManager.
java:168)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.doDeleteRecord(OAbstractPaginatedStorage.java:2076)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.deleteRecord(OAbstractPaginatedStorage.java:1009)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.exe
cuteDeleteRecord(ODatabaseDocumentTx.java:2103)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.deleteRecord(OT
ransactionNoTx.java:188)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.del
ete(ODatabaseDocumentTx.java:2599)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.del
ete(ODatabaseDocumentTx.java:121)
at com.orientechnologies.orient.core.record.ORecordAbstract.delete(OReco
rdAbstract.java:296)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelete.resul
t(OCommandExecutorSQLDelete.java:295)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbs
tract.pushResult(OCommandExecutorSQLResultsetAbstract.java:267)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.addRe
sult(OCommandExecutorSQLSelect.java:703)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.handl
eResult(OCommandExecutorSQLSelect.java:609)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execu
teSearchRecord(OCommandExecutorSQLSelect.java:571)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetch
FromTarget(OCommandExecutorSQLSelect.java:1481)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetch
ValuesFromIndexCursor(OCommandExecutorSQLSelect.java:2115)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searc
hForIndexes(OCommandExecutorSQLSelect.java:1979)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searc
hInClasses(OCommandExecutorSQLSelect.java:922)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbs
tract.assignTarget(OCommandExecutorSQLResultsetAbstract.java:199)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assig
nTarget(OCommandExecutorSQLSelect.java:507)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execu
teSearch(OCommandExecutorSQLSelect.java:489)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execu
te(OCommandExecutorSQLSelect.java:460)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.exe
cute(OCommandExecutorSQLDelegate.java:90)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.executeCommand(OAbstractPaginatedStorage.java:1522)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.command(OAbstractPaginatedStorage.java:1503)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.j
ava:72)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQuery
Abstract.java:33)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelete.execu
te(OCommandExecutorSQLDelete.java:178)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.exe
cute(OCommandExecutorSQLDelegate.java:90)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.executeCommand(OAbstractPaginatedStorage.java:1522)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.command(OAbstractPaginatedStorage.java:1503)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract
.execute(OCommandRequestTextAbstract.java:67)
at com.orientechnologies.orient.object.db.OCommandSQLPojoWrapper.execute
(OCommandSQLPojoWrapper.java:50)
at com.progress.isq.ipqos.activity.ActivityDataAccess.deleteByTime(Activ
ityDataAccess.java:352)
at com.progress.isq.ipqos.activity.ActivityService.delete(ActivityServic
e.java:265)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.deleteRul
eAndTrendHistory(MultiActivityServiceAdapter.java:324)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processAn
dCollectData(MultiActivityServiceAdapter.java:274)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityPro
cessor.processAndCollectData(DatabaseActivityProcessor.java:773)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processDa
ta(MultiActivityServiceAdapter.java:257)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processRe
sponse(MultiActivityServiceAdapter.java:219)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processAc
tivities(MultiActivityServiceAdapter.java:201)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityPro
cessor.processActivities(DatabaseActivityProcessor.java:431)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processAc
tivities(MultiActivityServiceAdapter.java:181)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.fetchAndS
toreActivities(MultiActivityServiceAdapter.java:111)
at com.progress.isq.ipqos.resources.plugins.openedge.work.WorkRunnable.p
erformPolling(WorkRunnable.java:60)
at com.progress.isq.ipqos.resources.plugins.openedge.work.DatabaseInstWo
rk.doWork(DatabaseInstWork.java:85)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseInstResourc
e.doWork(DatabaseInstResource.java:524)
at com.progress.isq.ipqos.ScheduledWorkShell.run(ScheduledWorkShell.java
:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)

@zerovian
Copy link
Author

zerovian commented Apr 7, 2016

orientdb memory usage keeps creeping up. There are 2 embedded databases. One is rarely touched, the other is in constant use by ~20 different threads, usually creating new records using db.save(). Database connections are pooled using OPartitionedDatabasePool. In all cases pooled connections are fetched and released before each operation. We never run out of connections from the pool, so I know i'm not leaking pooled connections.

A side question here is why is orientdb complaining about high memory usage? It runs fine for a few days days, then starts failing, then we start getting record not found exceptions when we try to delete records. ( have more stack traces, but the one above usually occurs first).

jconsole shows "UsedMemoryInMB" from O2QCacheMXBean at 92 almost constantly.

I can provide heap dump if needed. System is still running.

Using jconsole it shows a memory leak in loaded classes that goes up constantly until the error occurs, and then stops. I'm trying to track down what these classes are that are leaking. I'll get back to you today.
classleak

@andrii0lomakin
Copy link
Member

Thank you very much, I will start fix it from Monday.

@andrii0lomakin
Copy link
Member

@zerovian About memory consumption I suppose that is memory leak related to operations on ByteBuffers and channels, we will try to fix at Tuesday.

@andrii0lomakin
Copy link
Member

@zerovian sorry could you provide more information ? I will add new build there I need to check one more thing. And may be one more after that :-) or not depends on what we get.

@zerovian
Copy link
Author

zerovian commented Apr 7, 2016

What info do you need?

Given it is a leak of "loaded classes" according to jconsole. I'm running your kit and jconsole and have turned on -verbose:classes in java. But I don't seem to find what is leaking.

Let me know if you need me to test a new build.

@zerovian
Copy link
Author

zerovian commented Apr 7, 2016

Follow up to earlier comments. Ignore the jconsole graph above. It seems that the red line actually tracks "total loaded" classes, but not unloaded classes. It only goes up. The blue line is correct, so no memory leak in the class definitions. Java debug information is showing the proxy classes generated by javassist being unloaded by the JVM.

@andrii0lomakin
Copy link
Member

I think I will provide you new distribution soon. To double check on my side that jar is correct too.

@andrii0lomakin
Copy link
Member

Hi , new distribution https://drive.google.com/file/d/0B2oZq2xVp841WjVfRHBOV0hKenM/view?usp=sharing just in case.

@zerovian
Copy link
Author

This is exception(s) I got last night.

Exception at Tue Apr 12 04:05:43 EDT 2016: com.progress.isq.ipqos.WorkErrorException
Message (throw): Unexpected exception occurred during resource polling for perf-setup2-nt3:resource.database.remote.M3_l1_SDB33
Message (excp): Error during removal of entry by key
Stack Trace:
com.progress.isq.ipqos.WorkErrorException: Error during removal of entry by key
at com.progress.isq.ipqos.resources.plugins.openedge.work.WorkRunnable.performPolling(WorkRunnable.java:64)
at com.progress.isq.ipqos.resources.plugins.openedge.work.DatabaseInstWork.doWork(DatabaseInstWork.java:85)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseInstResource.doWork(DatabaseInstResource.java:524)
at com.progress.isq.ipqos.ScheduledWorkShell.run(ScheduledWorkShell.java:86)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.orientechnologies.orient.core.index.OIndexException: Error during removal of entry by key
at com.orientechnologies.orient.core.index.OIndexMultiValues.remove(OIndexMultiValues.java:218)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.addIndexEntry(OTransactionNoTx.java:260)
at com.orientechnologies.orient.core.index.OIndexTxAware.remove(OIndexTxAware.java:109)
at com.orientechnologies.orient.core.index.OClassIndexManager.deleteIndexKey(OClassIndexManager.java:279)
at com.orientechnologies.orient.core.index.OClassIndexManager.deleteIndexEntries(OClassIndexManager.java:577)
at com.orientechnologies.orient.core.index.OClassIndexManager.onRecordAfterDelete(OClassIndexManager.java:508)
at com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:274)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.callbackHooks(ODatabaseDocumentTx.java:1069)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeDeleteRecord(ODatabaseDocumentTx.java:2111)
at com.orientechnologies.orient.core.tx.OTransactionNoTx.deleteRecord(OTransactionNoTx.java:188)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.delete(ODatabaseDocumentTx.java:2599)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.delete(ODatabaseDocumentTx.java:121)
at com.orientechnologies.orient.core.record.ORecordAbstract.delete(ORecordAbstract.java:296)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelete.result(OCommandExecutorSQLDelete.java:295)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.pushResult(OCommandExecutorSQLResultsetAbstract.java:267)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.addResult(OCommandExecutorSQLSelect.java:703)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.handleResult(OCommandExecutorSQLSelect.java:609)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearchRecord(OCommandExecutorSQLSelect.java:571)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchFromTarget(OCommandExecutorSQLSelect.java:1481)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fetchValuesFromIndexCursor(OCommandExecutorSQLSelect.java:2115)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchForIndexes(OCommandExecutorSQLSelect.java:1979)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInClasses(OCommandExecutorSQLSelect.java:922)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.assignTarget(OCommandExecutorSQLResultsetAbstract.java:199)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCommandExecutorSQLSelect.java:507)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:489)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:460)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:90)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1522)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1503)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:72)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelete.execute(OCommandExecutorSQLDelete.java:178)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:90)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1522)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1503)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:67)
at com.orientechnologies.orient.object.db.OCommandSQLPojoWrapper.execute(OCommandSQLPojoWrapper.java:50)
at com.progress.isq.ipqos.activity.ActivityDataAccess.delete(ActivityDataAccess.java:364)
at com.progress.isq.ipqos.activity.ActivityService.delete(ActivityService.java:283)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityProcessor.processAndCollectData(DatabaseActivityProcessor.java:771)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processData(MultiActivityServiceAdapter.java:257)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processResponse(MultiActivityServiceAdapter.java:219)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processActivities(MultiActivityServiceAdapter.java:201)
at com.progress.isq.ipqos.resources.plugins.database.DatabaseActivityProcessor.processActivities(DatabaseActivityProcessor.java:431)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.processActivities(MultiActivityServiceAdapter.java:181)
at com.progress.isq.ipqos.activity.MultiActivityServiceAdapter.fetchAndStoreActivities(MultiActivityServiceAdapter.java:111)
at com.progress.isq.ipqos.resources.plugins.openedge.work.WorkRunnable.performPolling(WorkRunnable.java:60)
... 6 more
Caused by: java.lang.NullPointerException
at com.orientechnologies.orient.core.storage.cache.OCacheEntry.releaseExclusiveLock(OCacheEntry.java:92)
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperation.commitChanges(OAtomicOperation.java:394)
at com.orientechnologies.orient.core.storage.impl.local.paginated.atomicoperations.OAtomicOperationsManager.endAtomicOperation(OAtomicOperationsManager.java:168)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commitAtomicOperation(OAbstractPaginatedStorage.java:327)
at com.orientechnologies.orient.core.index.OIndexAbstract.commitStorageAtomicOperation(OIndexAbstract.java:914)
at com.orientechnologies.orient.core.index.OIndexMultiValues.remove(OIndexMultiValues.java:209)
... 52 more

@zerovian
Copy link
Author

I'll try with newer build.

@zerovian
Copy link
Author

zerovian commented Apr 13, 2016

Latest stack using build you posted yesterday.

Message (excp): Error during removal of entry by key
Stack Trace: https://gist.github.com/laa/3d0a9928e0d0c4b4d16b8ce19f35b1f8

@andrii0lomakin
Copy link
Member

Hi @zerovian I have put your stack trace as a gist to do not clutter issue with long stack traces.
Sorry that I did not answer at the same time.
Do you have in log message like "dataPointer is null, nuller stack trace " ?

@andrii0lomakin
Copy link
Member

Hi @zerovian , I found reason for that issue, fixing it now.

@andrii0lomakin
Copy link
Member

Did you try settings with last release of 2.1.x which I suggested to you ? Unfortunately I may fix this issue only in 2.1.x branch.

@andrii0lomakin
Copy link
Member

Well actually fix is super simple, I may put it in 2.1.11 distr for you, but in general it will be available only in 2.1.16

andrii0lomakin added a commit that referenced this issue Apr 18, 2016
@zerovian
Copy link
Author

I haven't gotten a chance to test with the suggested switches with a newer release. I'll assume they work and having a fix in 2.1.16 would be fine. I'll test with 2.1.16 build as soon as I get a chance. Hopefully soon. I'll note in 5831 if they address the performance issue or not.

Thanks for making this a priority.

andrii0lomakin added a commit that referenced this issue Apr 18, 2016
@andrii0lomakin
Copy link
Member

andrii0lomakin commented Apr 18, 2016

Fixed, @zerovian the same fix in 2.1.11 distribution https://drive.google.com/file/d/0B2oZq2xVp841WjVfRHBOV0hKenM/view?usp=sharing . About your second issue. When you confirm that this issue is fixed you should export database to JSON and then import back and second issue will be gone too.

@zerovian
Copy link
Author

great. I'll test the 2.1.11 build and let you know as soon as I can (might be a couple of days).

@zerovian
Copy link
Author

Update on this. So after 2 days of running with the patched version, there are no errors on index insert or record delete. Looks good so far.

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

No branches or pull requests

5 participants