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

Clean up the log files #82

Closed
sagarjha opened this issue Nov 30, 2018 · 5 comments
Closed

Clean up the log files #82

sagarjha opened this issue Nov 30, 2018 · 5 comments

Comments

@sagarjha
Copy link
Contributor

sagarjha commented Nov 30, 2018

We write the view to disk for fault tolerance. We also write the subgroup states to disk if the application is using persistent<T> variables in those subgroups. Then when we start our application, it checks if there are stored log files and if yes, builds the state from the log files as appropriate for a restart case.
While this is great, some of our applications in applications/demos and applications/tests are short-lived derecho groups that exit once they are done with their purpose. They aren't meant to work well with restarts. Furthermore, if we start one application which exits peacefully and then start another application without deleting the log files, the second application segfaults as it does not how to make sense of the logs. It is a nuisance to manually delete the log files every time we run an application for testing purposes.
For applications that have nothing to do with restart, we should
a) Delete the log files in the beginning of main. The log file location can be obtained from the configuration variable CONF_PERS_FILE_PATH.
b) Delete the log files at the end of main when the group object has been destroyed. This will help applications that are started afterwards which do care about the log files.
Note that this is a per-application fix, not a library fix, since we want the fresh start and restart case to look exactly similar from the Derecho API level: Check if log files exist and adjust accordingly. This is so that the applications that do require restart need not make any extra adjustments.

@KenBirman
Copy link
Contributor

KenBirman commented Dec 1, 2018 via email

@songweijia
Copy link
Contributor

I suggest add persistent state detection in the application layer. At start up, the testers which do not require the persistent state, they are responsible for cleaning it up. For those may need the state, detect if the persistent state exists and keep or clean it accordingly.

@sagarjha
Copy link
Contributor Author

sagarjha commented Dec 5, 2018

Okay, does this mean that if I run bandwidth_test which writes the log files and then I start objstore, objstore will figure out that the log file isn't relevant to it and clean it?

@songweijia
Copy link
Contributor

No. objstore will not do that. Actually, I discourage applications sharing a same persistent folder. But now this is what you can do with bandwidth_test now (in commit 2647d45):

./bandwidth_test --PERS/reset=true -- 2 0 1000 0

In such case, the persistent data will be cleaned.

@KenBirman
Copy link
Contributor

KenBirman commented Dec 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants