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

Restart claudb with persistence enabled, overwrite old persistence #30

Closed
advancedlogic opened this issue Oct 31, 2018 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@advancedlogic
Copy link

advancedlogic commented Oct 31, 2018

When I start claudb with persistence enabled and then I quit claudb (and I can see both AOF and RDB files in the directory) , once restarted it looks like claudb overwrite the old files and in this way everything cached in the past is lost

@tonivade tonivade added the bug label Nov 1, 2018
@tonivade tonivade added this to the 1.5.0 milestone Nov 1, 2018
@tonivade
Copy link
Owner

tonivade commented Nov 1, 2018

It seems that there's an issue when claudb restores the state using redo file. It seems that rdb file is restored correctly

Exception in thread "main" java.lang.ClassCastException: com.github.tonivade.resp.protocol.AbstractRedisToken$StringRedisToken cannot be cast to com.github.tonivade.resp.protocol.AbstractRedisToken$ArrayRedisToken
	at com.github.tonivade.claudb.persistence.PersistenceManager.importRedo(PersistenceManager.java:107)
	at com.github.tonivade.claudb.persistence.PersistenceManager.start(PersistenceManager.java:60)
	at com.github.tonivade.purefun.type.Option.ifPresent(Option.java:82)
	at com.github.tonivade.claudb.ClauDB.start(ClauDB.java:79)
	at com.github.tonivade.resp.RespServer.start(RespServer.java:90)
	at com.github.tonivade.claudb.Server.main(Server.java:50)

@tonivade tonivade self-assigned this Nov 1, 2018
tonivade added a commit that referenced this issue Nov 1, 2018
The commands are in this format:
- database
- command
- parameters

Then when the server starts, should execute first an select command and
finally then execute the real command

It seems that after master/slave replication was implemente, the AOF
file parse was broken
@tonivade
Copy link
Owner

tonivade commented Nov 5, 2018

Version 1.5.0 released with the persistence fixed, please @advancedlogic test it and let me now if its solved.

Thanks!

@tonivade tonivade closed this as completed Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants