GithubHelp home page GithubHelp logo

Comments (14)

stepcut avatar stepcut commented on May 25, 2024

I think what you want is createCheckpoint + createArchive. When you create a checkpoint, acid-state will restore by loading the most recent checkpoint and replaying only the events that happened after that checkpoint.

createArchive will move all the old checkpoints and event files that are no longer required to restore the state into a subdirectory. You can then delete the files from that directory if you really don't want them anymore.

That said, issue #22 needs to be resolved. Pull request #67 does not quite seem right, but hopefully we will get it fixed soon.

Do you think createCheckpoint + createArchive is what you want?

Or perhaps you are suggesting that you are seeing a single events-XXXXX.log file that is getting bigger and bigger even after your call createCheckpoint? I can not imagine how that would happen -- but if it is, that is a bug, AFAIK.

from acid-state.

sdroege avatar sdroege commented on May 25, 2024

I'm running createCheckPoint and createArchive one after another here. That is creating a new checkpoint file and moving the old one into the Archive directory, however it still uses the same events log as before (same filename, same content) and that one is still growing.

It only starts a new events log when restarting the application (which in my case means closing the state and opening it again on the next run).

from acid-state.

stepcut avatar stepcut commented on May 25, 2024

Looking at the code, I am starting to think your observations are correct and my understand of how it works is wrong. I am thinking that either createLocalCheckpoint or createLocalArchive should call cutFileLog for the entries log. My inclination is that createLocalCheckpoint should do it.

from acid-state.

sdroege avatar sdroege commented on May 25, 2024

Yes, I agree with that. It should be the creation of a checkpoint, and not the creation of the archive.

The creation of the checkpoint will move everything that is inside the events log into the checkpoint, so after the creation of the checkpoint the events log will contain a lot of obsolete data.

createLocalArchive currently only moves unused files (old checkpoints and old events logs) away, it does not change any file contents.

from acid-state.

stepcut avatar stepcut commented on May 25, 2024

If you want this done soon, submit a pull request. Otherwise it will happen 'someday'. I'm thinking a call to cutFileLog for the entries log should go before the call to withCoreState here,

https://github.com/acid-state/acid-state/blob/master/src/Data/Acid/Local.hs#L180

from acid-state.

sdroege avatar sdroege commented on May 25, 2024

Yes I was looking at the code already, but I'm not 100% sure I understand what all those functions do yet. Need to read more code

Just to be sure, after calling cutFileLog on the entries log, a) the old events log file is closed and b) a new events log file was created. And all this in a threadsafe way (i.e. if other updates are happening in the meantime, they will only succeed after the new events log is opened and they are stored in there)?

from acid-state.

sdroege avatar sdroege commented on May 25, 2024

If the events log is cut before creating the checkpoint, then the new events log might contain events that are already in the checkpoint (new updates seem to be possible while the checkpoint is created), if it is cut afterwards then the old events log might contain events that are in the checkpoint.

I guess the first situation is better

from acid-state.

stepcut avatar stepcut commented on May 25, 2024

As far as I know that is correct. Better to have a few extra events in the
new event file than to still require some events from the old file.

  • jeremy

On Tue, May 31, 2016 at 11:19 AM, Sebastian Drรถge [email protected]
wrote:

If the events log is cut before creating the checkpoint, then the new
events log might contain events that are already in the checkpoint (new
updates seem to be possible while the checkpoint is created), if it is cut
afterwards then the old events log might contain events that are in the
checkpoint.

I guess the first situation is better

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#73 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAKpTak4fiqsCNw7v2JPyB3nJ8vf_DCyks5qHF-pgaJpZM4Iqfgk
.

from acid-state.

sdroege avatar sdroege commented on May 25, 2024

Great, thanks for confirming :) Works well for me

from acid-state.

matchwood avatar matchwood commented on May 25, 2024

I've run into exactly this issue as well - slightly horrified to find a 17GB events log sittting around on a server for a checkpoint of about 70MB. Like @sdroege I was calling createCheckpoint, createArchive via a cron script every night, so I was a little surprised!

Do you know if @sdroege's fix for this likely to be on hackage soon?

Cheers

from acid-state.

ddssff avatar ddssff commented on May 25, 2024

There seems to be an issue with the Travis builds under ghc-7.6 and ghc-7.8.

from acid-state.

gromakovsky avatar gromakovsky commented on May 25, 2024

@stepcut can provide us some information regarding when PR #74 (which fixes this issue) will be merged into master?

from acid-state.

gromakovsky avatar gromakovsky commented on May 25, 2024

Alright, thanks for merge.

from acid-state.

adamgundry avatar adamgundry commented on May 25, 2024

Looks like this can be closed - fixed in 0.14.2.

from acid-state.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.