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

DOC: Note about stopping container and using previous database state needs update/ or it's inaccurate #1544

Open
DeaMariaLeon opened this issue Nov 28, 2023 · 3 comments

Comments

@DeaMariaLeon
Copy link
Contributor

DeaMariaLeon commented Nov 28, 2023

In the documentation, there is this note under Makefile targets:

You can use Ctrl+C to terminate the containerized stack (this only stops containers, 
and the next invocation of make run-app will use previous database state 
– invoke make teardown-app to stop and remove containers). 
If you wish to clear all database tables during local development you can hit http://127.0.0.1:5000/api/wipe-db with the browser or with e.g. curl.

After stopping the container with Ctrl+C, and then entering make run-app on the terminal, the database is not reusing previous data, it is empty. Or, am I misunderstanding the note?

On the other hand, when if I hit http://127.0.0.1:5000/api/wipe-db, the home page seems to have no "CI runs", it's empty. But looking at the section of "benchmarks by name", the names and results of benchmarks are still available. So, this is not clearing all database tables.
So, after clicking on http://127.0.0.1:5000/api/wipe-db:

Screenshot 2023-11-28 at 10 35 02 But "benchmark names" area: Screenshot 2023-11-28 at 10 35 47
@austin3dickey
Copy link
Member

@jgehrcke would you mind adding your thoughts here? I think I've experienced something similar.

@jgehrcke
Copy link
Member

jgehrcke commented Jan 9, 2024

After stopping the container with Ctrl+C, and then entering make run-app on the terminal, the database is not reusing previous data, it is empty. Or, am I misunderstanding the note?

I'd need to test things out manually to reply with confidence. For now I'd just like to acknowledge that it may very well be that docs got out of sync with actual behavior.

Volumes are not generally needed for keeping state: as far as the quoted docs section is concerned, the intention seemingly was that state is kept via only stopping containers (not removing them), i.e. the database process would just continue where previously left off.

The teardown-app command would force-stop and remove all container in the Docker compose step.

After pressing ctrl+c you can find via docker ps if the containers are in fact still present or not. If they are, docker compose should (be able to) reuse them next time.

But looking at the section of "benchmarks by name", the names and results of benchmarks are still available. So, this is not clearing all database tables.

Good find, sorry for the confusion. That's expected because this page is served from an in-memory cache which is not wiped by the wipe-db API endpoint. After a short while (a few minutes max) the data should disappear; that cache is periodically rebuilt from the database.

@DeaMariaLeon
Copy link
Contributor Author

After pressing ctrl+c you can find via docker ps if the containers are in fact still present or not. If they are, docker compose should (be able to) reuse them next time.

Yes thanks, the containers don't disappear, but the data are gone. At least they were not shown. That's why I did this: #1559

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

No branches or pull requests

3 participants