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

Don't wipe the database out during installation #180

Open
njm506 opened this issue Aug 28, 2014 · 10 comments
Open

Don't wipe the database out during installation #180

njm506 opened this issue Aug 28, 2014 · 10 comments

Comments

@njm506
Copy link
Contributor

njm506 commented Aug 28, 2014

I've begun testing this module across a couple of VMs. On setting up the second VM (with a bit of test data in the database), I've found that the database gets reinitialized, wiping out the data.

This is due to Exec['setup gitlab database'] looking at a local file to determine whether the database needs "setting up".

For such a dangerous operation, one might speculate that this functionality should be separate from the main install process (either as a separate class or by setting a parameter).

@brianvans
Copy link

+1

@StrangeWill
Copy link

+1, funny enough I seem to be missing the local file for whatever reason, and without a sane check it's eating my database on every puppet run...

@becosta
Copy link

becosta commented Apr 13, 2015

Same issue here with postgresql backend, my database is wiped out on every run.

@StrangeWill
Copy link

@becosta Logged issue #215, thought it was me doing something dumb (had a failure during install due to a missing Redis server) during my first run but did a fresh clean install and still had that issue.

@cyberkov
Copy link

+1

@sbadia
Copy link
Owner

sbadia commented Aug 5, 2015

Hi, I'm not able to reproduce the issue (with debian or centos) https://paste.debian.net/plainh/f09ad8ae

@toepi
Copy link
Contributor

toepi commented Aug 5, 2015

Hi @sbadia, this issue is related to #215 which was fixed with pull request #217. But I think this issue is not close because the discussion about a flag?

I think you should include a boolean which say yes create (wipeout) database if needed (no .done-file) or never do it. I think about create databases incl. schema with something like cpitman/database_schema - so gitlab must not do it again? Or a mutlinode cluster - which currently mean ever member recreate the database.

@njm506
Copy link
Contributor Author

njm506 commented Aug 12, 2015

Yes, to clarify, the original issue was with regards to setting up multiple front-ends which share the same database and filestore (for clustering). Building an additional node wipes the database as the new node doesn't have the local file to say the database has been initialized.

I was expecting it would come down to a new parameter to determine whether the code should ever try to wipe the db, rather than relying on a local file. I haven't retested this recently.

@toepi
Copy link
Contributor

toepi commented Aug 12, 2015

stupid question: It is possible to check if a database has a schema/tables? I know Oracle has some views for this - mysql show tables but postgres? So it is possible to replace file which this check?

@joshuaspence
Copy link

+1 on this... I currently have this ugly hack in place to safeguard against this:

  exec { 'prevent setup gitlab database':
    command => "touch /home/git/.gitlab_setup_done",
    before  => Exec['setup gitlab database'],
    require => User['git'],
  }

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

8 participants