Google Groups

Re: Wrong chunk in embedded mode


Sebastian Sdorra Mar 27, 2012 7:55 AM
Posted in group: OrientDB
Hi,
I have the same problem with the version 1.0rc9 and i can reproduce the problem without the java program from my first post.

$ ./console.sh  
OrientDB console v.1.0rc9 (build 11668) www.orientechnologies.com
Type 'help' to display all the commands supported.

> create database local:/tmp/db root F8692440147081DDF711C5386C69AC6D5EFC9D264BB3AAF296DD02A23B60C5A4 local document
Creating database [local:/tmp/db] using the storage type [local]...
Database created successfully.

Current database is: local:/tmp/db

> check database

Checking database 'db'...

- Checking cluster coherence...
 +- Checking cluster 'internal' (id=0)...
 +- Checking cluster 'index' (id=1)...
 +- Checking cluster 'default' (id=2)...
 +- Checking cluster 'orole' (id=3)...
 +- Checking cluster 'ouser' (id=4)...
 +- Checking cluster 'orids' (id=5)...

- Checking data chunks integrity...
Mar 27, 2012 4:45:35 PM com.orientechnologies.common.log.OLogManager log
WARNING: [OStorageLocal.check] Deleted chunk at position 66 (recordSize=-673) points to the valid RID #11364:7306634602413835116 instead of #-1:-1

Check of database completed in 6ms:
- Total records checked: 10
- Total chunks checked.: 11
- Warnings.............: 1
- Errors...............: 0

> create class tuser

Class created successfully with id=4

> check database

Checking database 'db'...

- Checking cluster coherence...
 +- Checking cluster 'internal' (id=0)...
 +- Checking cluster 'index' (id=1)...
 +- Checking cluster 'default' (id=2)...
 +- Checking cluster 'orole' (id=3)...
 +- Checking cluster 'ouser' (id=4)...
 +- Checking cluster 'orids' (id=5)...
 +- Checking cluster 'tuser' (id=6)...

- Checking data chunks integrity...
Mar 27, 2012 4:45:47 PM com.orientechnologies.common.log.OLogManager log
WARNING: [OStorageLocal.check] Found wrong chunk 822, cause: 
com.orientechnologies.orient.core.exception.OStorageException: Error on reading record from file 'default.0.oda', position 822, size 1.01Gb: the record size is bigger then the file itself (2.62Kb). Probably the record is dirty due to a previous crash. It is strongly suggested to restore the database or export and reimport this one.
at com.orientechnologies.orient.core.storage.impl.local.ODataLocal.getRecord(ODataLocal.java:168)
at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.check(OStorageLocal.java:546)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.checkDatabase(OConsoleDatabaseApp.java:1063)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:222)
at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:116)
at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:84)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.main(OConsoleDatabaseApp.java:127)

Check of database completed in 8ms:
- Total records checked: 10
- Total chunks checked.: 4
- Warnings.............: 0
- Errors...............: 1

> exit

On Tuesday, March 20, 2012 4:28:28 PM UTC+1, Sebastian Sdorra wrote:
Hi,
I'm trying to use Orientdb 1.0rc8 (from maven repository) in embedded
mode, but the database seems to be corrupt after creation.
Here is a short program which causes the problem in my environment:

public class Main
{

 public static final String CONFIG =
     "<orient-server>"
   +   "<network>"
   +     "<protocols />"
   +     "<listeners />"
   +   "</network>"
   +   "<users>"
   +     "<user name=\"root\" password=\"secret\" resources=\"*\"/>"
   +   "</users>"
   +   "<properties>"
   +     "<entry name=\"server.cache.file.static\" value=\"false\"/>"
   +     "<entry name=\"log.console.level\" value=\"debug\"/>"
   +   "</properties>"
   + "</orient-server>";

 public static void main(String[] args) throws Exception
 {
   File directory = new File("/tmp/db");
   OServer server = OServerMain.create();

   server.startup(CONFIG);
   server.activate();

   ODatabaseDocumentTx connection =
     new ODatabaseDocumentTx("local:".concat(directory.getPath()));

   connection.create();

   OSchema schema = connection.getMetadata().getSchema();
   OClass tuser = schema.createClass("TUser");
   tuser.createProperty(
     "id", OType.STRING
   ).createIndex(INDEX_TYPE.UNIQUE);
   tuser.createProperty(
     "name", OType.STRING
   );

   schema.save();

   connection.close();

   server.shutdown();
 }
}



After the program is finished, i check the database with the console command:


OrientDB console v.1.0rc8 (build 11421) www.orientechnologies.com
Type 'help' to display all the commands supported.

> connect local:/tmp/db admin admin
Connecting to database [local:/tmp/db] with user 'admin'...OK

> check database

Checking database 'db'...

- Checking cluster coherence...
 +- Checking cluster 'internal' (id=0)...
 +- Checking cluster 'index' (id=1)...
 +- Checking cluster 'default' (id=2)...
 +- Checking cluster 'orole' (id=3)...
 +- Checking cluster 'ouser' (id=4)...
 +- Checking cluster 'tuser' (id=5)...

- Checking data chunks integrity...
Mar 20, 2012 2:49:59 PM com.orientechnologies.common.log.OLogManager log
WARNING: [OStorageLocal.check] Found wrong chunk 2386, cause:
com.orientechnologies.orient.core.exception.OStorageException: Error
on reading record from file 'default.0.oda', position 2386, size
1.76Gb: the record size is bigger then the file itself (3.11Kb).
Probably the record is dirty due to a previous crash. It is strongly
suggested to restore the database or export and reimport this one.
       at com.orientechnologies.orient.core.storage.impl.local.ODataLocal.getRecord(ODataLocal.java:168)
       at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.check(OStorageLocal.java:546)
       at com.orientechnologies.orient.console.OConsoleDatabaseApp.checkDatabase(OConsoleDatabaseApp.java:1030)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:208)
       at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:115)
       at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:83)
       at com.orientechnologies.orient.console.OConsoleDatabaseApp.main(OConsoleDatabaseApp.java:127)

Check of database completed in 14ms:
- Total records checked: 11
- Total chunks checked.: 10
- Warnings.............: 0
- Errors...............: 1


Is there a error in the way i create the database or is this a bug of
orientdb? I'm running Mac OS 10.6.8 and Java 1.6.0_29.