Cheers,
/peter neubauer
Google: neubauer.peter
Skype: peter.neubauer
Phone: +46 704 106975
LinkedIn: http://www.linkedin.com/in/neubauer
Twitter: @peterneubauer
Tungle: tungle.me/peterneubauer
brew install neo4j && neo4j start
heroku addons:add neo4j
Would it be possible to look at the logs of the uncommited transactions (after finding out the binary format of the logs) so that I can make a list of the uncommited transactions. Then create a copy of the database where the logs are deleted so that I can start up the database without a TransactionFailureException message so that I can inspect the database to find out which uncommited transactions among the list just mentioned have been written to the database and which have not been written to the database or only partially written. And based off this write some code that will fix the parts of the database that are only partially written and hope that this process doesn't miss anything else that would leave the database inconsistent.
Thanks for the tool. Unfortunately, I encountered a new problem.I changed nioneo_logical_log.1 to set the log version to 753 from 754 like you suggested.After that, on startup the database gave a new error which I tracked to the lucene index. It was the same kind of error so I had to change index/lucene.log.1 to set the log version to 786 from 787.Before starting up the database again I checked that the directory index/lucene/node/positions/contained 4.5 gigabytes of data across 40 files. But the very act of starting up the database deleted everything in that directory leaving only 6 kilobytes among the three filesindex/lucene/node/positions/segments.genindex/lucene/node/positions/segments_zfindex/lucene/node/positions/write.lockThankfully I made a backup of the database before trying these changes. Any clue as to why all the files in the directory index/lucene/node/positions/ were deleted on starting up the database?On Mon, Feb 13, 2012 at 10:57 PM, Mattias Persson <mat...@neotechnology.com> wrote:In that case it's probably better to change the version in the logical log. I quickly wrote a tool to do that: http://pastebin.com/iiPMSPFA , use it like:
java -cp .... org.neo4j.ChangeLogVersion my/db/nioneo_logical_log.1
to just have it display which version that log is set to have, or:
java -cp .... org.neo4j.ChangeLogVersion my/db/nioneo_logical_log.1 753
to set it to a specific version. If the exception message said "Wrong version in log. Expected 753, but got 754" then that means that the log version is 754 but it's expected to be 753, so set the log version to 753. The code is written, compiled and tested against the exact same version that you're running (1.4.M06). After this is done, if it succeeds, it would be wise to move to a more recent version... perhaps 1.5.2 or 1.6. And please do a backup before running this tool.
2012/2/14 Cary Cherng <cch...@gmail.com>Since data is stored in binary format in neostore is there some tool I can use to view it and maybe edit it?On Fri, Feb 10, 2012 at 1:27 AM, Mattias Persson <mat...@neotechnology.com> wrote:
Thanks, oh and I forgot: could you send messages.log also?2012/2/10 Cary Cherng <cch...@gmail.com>I have attached log.tar.gz which has filesneostorenioneo_logical.log1nioneo_logical.log2
If I go about editing neostore, what bytes do I need to change? What is the binary format of neostore?On Thu, Feb 9, 2012 at 11:25 PM, Mattias Persson <mat...@neotechnology.com> wrote:
I'm guessing it could be solved by editing the neostore file which carries, among other things, next expected log version. But before doing that could you perhaps send me all these files:
nioneo_logical.log*
neostore
in a .tar.gz or something?2012/2/9 Cary Cherng <cch...@gmail.com>
I have the db but I don't think there is an easy way to send it to you. It's 5 gigabytes in size.
Using the command "DumpLogicalLog" that you told me about seemed to indicate that there were no unresolved transactions. However, when I start up the database it complains about "wrong version in log".This suggests that although the transactions have been resolved, the metadata that keeps track of what is the current log version is out of sync with the version number in the logs and all that is needed is to delete the db's reference to a log version. If there is an easy way to get the db to forget about the log version to expect, perhaps by editing some file or deleting some file, I could heuristically test the db after that to see if everything is fine.
On Thu, Feb 9, 2012 at 2:39 AM, Mattias Persson <mat...@neotechnology.com> wrote:This is an interesting case, do you still have the db lying around and able to send it to me somehow (dropbox or something)?
I'm having a similar problem. After the graph is closed down
ungracefully, recovery often (but not always) fails with messages
similar to those shown below. Is there any progress on this? How can
I complete the recovery?
gremlin> neo = new Neo4jGraph("graph-output")
Feb 21, 2012 1:49:14 PM
org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog
doInternalRecovery
INFO: Non clean shutdown detected on log [graph-output/
nioneo_logical.log.2]. Recovery started ...
Feb 21, 2012 1:49:16 PM
org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog
doInternalRecovery
INFO: Non clean shutdown detected on log [/Users/pespinoza/Documents/
git/neo4j_import/graph-output/index/lucene.log.2]. Recovery
started ...
Feb 21, 2012 1:49:17 PM org.neo4j.kernel.impl.transaction.TxManager
init
INFO: Unresolved transactions found, recovery started ...
No mapping found for branchId[0x162374]
Display stack trace? [yN] y
org.neo4j.graphdb.TransactionFailureException: No mapping found for
branchId[0x162374]
at
org.neo4j.kernel.impl.transaction.XaDataSourceManager.getXaResource(XaDataSourceManager.java:
189)
at
org.neo4j.kernel.impl.transaction.TxManager.getXaResource(TxManager.java:
1037)
at
org.neo4j.kernel.impl.transaction.TxManager.buildRecoveryInfo(TxManager.java:
515)
at org.neo4j.kernel.impl.transaction.TxManager.recover(TxManager.java:
322)
at org.neo4j.kernel.impl.transaction.TxManager.init(TxManager.java:
203)
at org.neo4j.kernel.impl.transaction.TxModule.start(TxModule.java:
101)
at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:155)
at
org.neo4j.kernel.EmbeddedGraphDbImpl.<init>(EmbeddedGraphDbImpl.java:
190)
at
org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:
80)
at
org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:
64)
at
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.<init>(Neo4jGraph.java:
94)
at
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.<init>(Neo4jGraph.java:
67)
at
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.<init>(Neo4jGraph.java:
63)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:
77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite
$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:
102)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:
54)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
182)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
190)
at groovysh_evaluate.run(groovysh_evaluate:32)
at groovysh_evaluate$run.call(Unknown Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
42)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
112)
at
org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:
67)
at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown
Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
42)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
116)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:
152)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown
Source)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
42)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
116)
at
org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:
88)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super
$2$work(InteractiveShellRunner.groovy)
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
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:
128)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:
148)
at
org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:
100)
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 org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite
$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:
267)
at
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:
52)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:
46)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:
133)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:
137)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:
57)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super
$2$run(InteractiveShellRunner.groovy)
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
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:
128)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:
148)
at
org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:
66)
at com.tinkerpop.gremlin.groovy.console.Console.<init>(Console.java:
50)
at com.tinkerpop.gremlin.groovy.console.Console.<init>(Console.java:
57)
at com.tinkerpop.gremlin.groovy.console.Console.main(Console.java:62)
On Jan 26, 2:46 pm, fork <cche...@gmail.com> wrote:
> Mattias, I tried deleting
>
> nioneo_logical.log.1
> nioneo_logical.log.2
>
> but then the database raised an IllegalStateException:
>
> Caused by: java.lang.IllegalStateException: Active marked as 1 but no
> dragon\nioneo_logical.log.1 exist
> at
> org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog.open(XaLogicalLo g.java:175)
> at
> org.neo4j.kernel.impl.transaction.xaframework.XaContainer.openLogicalLog(Xa Container.java:97)
> at
> org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.<init>(NeoStoreXaDataS ource.java:141)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
> org.neo4j.kernel.impl.transaction.XaDataSourceManager.create(XaDataSourceMa nager.java:75)
> at
> org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModule.java :147)
> ... 24 more
>
> So then I tried to also delete nioneo_logical.log.active
>
> but this caused it to revert back to giving the exception
>
> Caused by: java.io.IOException: Wrong version in log. Expected 786, but got
> 787
> at
> org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog.readAndAssertLog Header(XaLogicalLog.java:721)
> at
> org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog.rotate(XaLogical Log.java:1374)
> at
> org.neo4j.kernel.impl.transaction.xaframework.LogBackedXaDataSource.rotateL ogicalLog(LogBackedXaDataSource.java:96)
Cheers,
/peter neubauer
G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer
Neo4j 1.6 released - dzone.com/6S4K
The Neo4j Heroku Challenge - http://neo4j-challenge.herokuapp.com/