Transitioning to 1.7-rc1 from 1.6.3

219 views
Skip to first unread message

Odysseas

unread,
Feb 18, 2014, 8:45:27 AM2/18/14
to orient-...@googlegroups.com

We are transitioning our application from 1.6.3 to 1.7-rc1 and have run into an issue when re-deploying the application. When we first deploy the application everything is working fine but if we redeploy it, it doesn't seem
to be shutting down properly because during the restart we are getting the following exception:

Caused by: com.orientechnologies.orient.core.exception.OSerializationException: Cannot load database's configuration. The database seems to be corrupted.
at com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:74)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.addDefaultClusters(OLocalPaginatedStorage.java:1933)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.open(OLocalPaginatedStorage.java:191)
... 137 more
Caused by: com.orientechnologies.common.concur.lock.OLockException: File '/mnt/sysnet/person-db/database.ocf' is locked by another process, maybe the database is in use by another process. Use the remote mode with a OrientDB server to allow multiple access to the same database.
at com.orientechnologies.orient.core.storage.fs.OAbstractFile.lock(OAbstractFile.java:375)
at com.orientechnologies.orient.core.storage.fs.OAbstractFile.openChannel(OAbstractFile.java:641)
at com.orientechnologies.orient.core.storage.fs.OAbstractFile.open(OAbstractFile.java:141)
at com.orientechnologies.orient.core.storage.impl.local.OSingleFileSegment.open(OSingleFileSegment.java:53)
at com.orientechnologies.orient.core.storage.impl.local.OStorageConfigurationSegment.load(OStorageConfigurationSegment.java:54)

During the shutdown process we close the pool first (OrientGraphFactory) and then shutdown the storage as before:

            final OStorage stg = Orient.instance().getStorage(entityStore.getStorageName());
            if (stg != null) {
                stg.close();
            }

The close on the storage is performed successfully. What are we missing here? Is there a way to track who has the storage still open?

Thanks,
Odysseas

Odysseas

unread,
Feb 18, 2014, 9:44:55 AM2/18/14
to orient-...@googlegroups.com
We to close the storage using the force option but that ends up breaking the index and corrupting the database for good. Here is the exception we get when restarting the application:

SEVERE: Error on using index idx-Blockinground-0-blockingKeyValue in query 'select  from Blockinground-0 where blockingKeyValue = 'Noack.1978''. Probably you need to rebuild indexes. Now executing query using cluster scan
java.lang.NullPointerException
at com.orientechnologies.orient.core.index.sbtree.local.OSBTree.get(OSBTree.java:163)
at com.orientechnologies.orient.core.index.engine.OSBTreeIndexEngine.get(OSBTreeIndexEngine.java:352)
at com.orientechnologies.orient.core.index.OIndexMultiValues.get(OIndexMultiValues.java:62)
at com.orientechnologies.orient.core.index.OIndexMultiValues.get(OIndexMultiValues.java:1)
at com.orientechnologies.orient.core.index.OIndexAbstractDelegate.get(OIndexAbstractDelegate.java:76)
at com.orientechnologies.orient.core.index.OIndexTxAwareMultiValue.get(OIndexTxAwareMultiValue.java:45)
at com.orientechnologies.orient.core.index.OIndexTxAwareMultiValue.get(OIndexTxAwareMultiValue.java:1)
at com.orientechnologies.orient.core.sql.operator.OQueryOperatorEquals.executeIndexQuery(OQueryOperatorEquals.java:131)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchForIndexes(OCommandExecutorSQLSelect.java:701)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInClasses(OCommandExecutorSQLSelect.java:614)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.assignTarget(OCommandExecutorSQLResultsetAbstract.java:139)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCommandExecutorSQLSelect.java:354)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:328)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:313)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:57)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.executeCommand(OStorageEmbedded.java:96)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:85)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:69)
at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:82)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:29)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.query(ODatabaseRecordAbstract.java:557)
at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.query(ODatabaseRecordWrapperAbstract.java:188)

Andrey Lomakin

unread,
Feb 18, 2014, 11:36:08 AM2/18/14
to orient-database
Hi,
Sorry, rc1 has issue in process shutdown, could you try snapshot, we should release it this week.


--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Odysseas

unread,
Feb 20, 2014, 1:06:15 PM2/20/14
to orient-...@googlegroups.com
We are seeing various concurrent modification exceptions after moving to 1.7-rc1. Once these start to occur, we then end up getting exceptions about no more resources in the pool (example exception shown at the bottom). Do you have any ideas as to why we are seeing these exceptions? They are occurring during read operations so should we be using non transactional connections for these operations?  I haven't investigate the OrientDB code yet but I don't understand why the load operation turns into an add operation in this step. Any clues would be highly appreciated. Thanks, Odysseas
 
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.addRecord(OTransactionOptimistic.java:314)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:291)
 

SEVERE: Error on releasing database 'person-db' in pool
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:894)
at java.util.HashMap$ValueIterator.next(HashMap.java:922)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.rollback(OTransactionOptimistic.java:252)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.rollback(ODatabaseRecordTx.java:163)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.rollback(ODatabaseDocumentTx.java:468)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTxPooled.close(ODatabaseDocumentTxPooled.java:95)
at org.openhie.openempi.entity.dao.orientdb.EntityDaoOrientdb.executeQuery(EntityDaoOrientdb.java:478)
 

and 

rientdb.java:473) - Failed while trying to query the system using entity: person due to com.orientechnologies.orient.core.exception.OTransactionException: Invalid state of the transaction. The transaction must be begun.
com.orientechnologies.orient.core.exception.OTransactionException: Invalid state of the transaction. The transaction must be begun.
at com.orientechnologies.orient.core.tx.OTransactionRealAbstract.checkTransaction(OTransactionRealAbstract.java:342)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.addRecord(OTransactionOptimistic.java:314)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:291)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(ODatabaseRecordTx.java:203)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.load(ODatabaseRecordAbstract.java:1)
at com.orientechnologies.orient.core.id.ORecordId.getRecord(ORecordId.java:296)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.fillSearchIndexResultSet(OCommandExecutorSQLSelect.java:832)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchForIndexes(OCommandExecutorSQLSelect.java:716)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.searchInClasses(OCommandExecutorSQLSelect.java:614)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLResultsetAbstract.assignTarget(OCommandExecutorSQLResultsetAbstract.java:139)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.assignTarget(OCommandExecutorSQLSelect.java:354)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.executeSearch(OCommandExecutorSQLSelect.java:328)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.execute(OCommandExecutorSQLSelect.java:313)
at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:57)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.executeCommand(OStorageEmbedded.java:96)
at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:85)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:69)
at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:82)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:29)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.query(ODatabaseRecordAbstract.java:557)
at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.query(ODatabaseRecordWrapperAbstract.java:188)

com.orientechnologies.common.concur.lock.OLockException: Not more resources available in pool. Requested resource: plocal:/mnt/sysnet/person-db
at com.orientechnologies.common.concur.resource.OResourcePool.getResource(OResourcePool.java:46)
at com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:93)
at com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:78)
at com.orientechnologies.orient.core.db.ODatabasePoolBase.acquire(ODatabasePoolBase.java:105)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:121)
at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:37)
at com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:54)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:49)

Andrey Lomakin

unread,
Feb 21, 2014, 6:13:00 AM2/21/14
to orient-database
Hi Odysseas,
I will finish commercial issue during 2 days then I will help you with migration.


--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Odysseas Pentakalos

unread,
Feb 21, 2014, 6:52:51 AM2/21/14
to orient-...@googlegroups.com
Thanks Andrey


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/GDSDoWgJ-PU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Odysseas

unread,
Feb 25, 2014, 10:36:31 AM2/25/14
to orient-...@googlegroups.com
Andrey,

I would really appreciate even a hint into what we should look into to resolve these exceptions, when you have some time. We are a bit stuck.

Thanks.

Odysseas

unread,
Feb 28, 2014, 1:16:38 PM2/28/14
to orient-...@googlegroups.com


On Tuesday, February 18, 2014 8:45:27 AM UTC-5, Odysseas wrote:

Odysseas

unread,
Feb 28, 2014, 1:17:28 PM2/28/14
to orient-...@googlegroups.com

I am continuing to investigate this problem to try and resolve it. It looks like if you do a query against the database that looks at records that are temporary, we get an exception.

For example, while importing lots of records into the database using one transaction for a fixed block of records (not a single transaction for all N records that need to be imported but one transaction for a block M of records where M << N), if before the transaction is committed you do a query such as (select count(*) from V) then we get an exception to the read operation that complains about the state of the transaction being in an invalid state. 

If my analysis is correct, then this to me is either a bug or we are not using the API correctly. I'll ask again for suggestions on what is causing this.

Thanks,
Odysseas

Andrey Lomakin

unread,
Mar 5, 2014, 7:39:48 AM3/5/14
to orient-database
Hi,
I tried 

@Test
  public void testDirtyTxQuery() throws Exception {
    graph.createVertexType("vTX");

    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicBoolean shutdownFlag = new AtomicBoolean(false);

    final ExecutorService executorService = Executors.newCachedThreadPool();

    final Future inserter = executorService.submit(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
OrientGraph graph = new OrientGraph(DB_URL);
    
          latch.await();
          int counter = 0;

        while (!shutdownFlag.get()) {
          graph.addVertex("class:vTX", "val", "val" + counter);
          counter++;

graph.command(new OCommandSQL("select count(*) from VTx")).execute();
          if (counter % 100 == 0)
            graph.commit();
        }

        return null;
      }
    });

    final Future fetcher = executorService.submit(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
OrientGraph graph = new OrientGraph(DB_URL);
        latch.await();

        while (!shutdownFlag.get())
          graph.command(new OCommandSQL("select count(*) from VTx")).execute();

        return null;
      }
    });

    latch.countDown();
    Thread.sleep(300000);

  shutdownFlag.set(true);

    inserter.get();
    fetcher.get();
  }


No issues.

Could you provide test case ?


--
 
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Odysseas Pentakalos

unread,
Mar 5, 2014, 11:49:53 AM3/5/14
to orient-...@googlegroups.com
Andrey,
I'll try to re-create the issue I have in a test case and send it to you. I noticed in the forum today that someone else was getting the OIndexException in a multi-threaded scenario.
Thanks,
Odysseas


--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/GDSDoWgJ-PU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Andrey Lomakin

unread,
Mar 6, 2014, 11:56:28 AM3/6/14
to orient-database
Hi Odysseas,
Answer from user about this exception.

I just realize that you responded my deleted post.
The problem was in my application. DB works fine.
That's why I deleted this post.
Thanks though!
-Andrey

Looking forward for your test case. 
Reply all
Reply to author
Forward
0 new messages