Skip to content

ROX-12556: Always initialize from scratch #941

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

Merged
merged 6 commits into from
Sep 27, 2022
Merged

ROX-12556: Always initialize from scratch #941

merged 6 commits into from
Sep 27, 2022

Conversation

RTann
Copy link
Collaborator

@RTann RTann commented Sep 21, 2022

Sometimes people choose to restart the nodes, which keeps the volumes but causes pods to restart. When this happens, scanner-db initialization does not work properly, as it expects to start from scratch every time. Let's enforce starting from scratch every time by deleting any data which may already exist prior to startup.

@ghost
Copy link

ghost commented Sep 21, 2022

Images are ready for the commit at 1cb2f0a.

To use the images, use the tag 2.26-20-g1cb2f0a53c.

Copy link
Contributor

@connorgorman connorgorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a different approach which would be to rm -rf the database path and let it start from scratch. Wdyt? I worry that if we're initializing and get turned off then the database would be in a half state and it would be better to just be completely fresh

@RTann
Copy link
Collaborator Author

RTann commented Sep 21, 2022

I would suggest a different approach which would be to rm -rf the database path and let it start from scratch. Wdyt? I worry that if we're initializing and get turned off then the database would be in a half state and it would be better to just be completely fresh

Good idea. We usually assume we start from scratch anyway, so we should now enforce it for correctness

@RTann RTann requested a review from connorgorman September 21, 2022 20:14
@RTann RTann changed the title ROX-12556: ScannerDB does not start up properly if volume already exists ROX-12556: Always initialize from scratch Sep 23, 2022
@@ -24,6 +24,8 @@ spec:
env:
- name: POSTGRES_PASSWORD_FILE
value: "/run/secrets/stackrox.io/secrets/password"
command: ["docker-entrypoint.sh"]
args: ["init", "postgres", "-c", "config_file=/etc/postgresql.conf"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does stackrox repo do?

@RTann RTann merged commit 0f6d6d1 into master Sep 27, 2022
@RTann RTann deleted the ROX-12556 branch September 27, 2022 00:33
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

Successfully merging this pull request may close these issues.

2 participants