MongoDB deletes my db after unclean shutdown?

nanythery

Nadine M. Thêry

Posted on July 3, 2019

MongoDB deletes my db after unclean shutdown?

Hey guys!

I am just starting with MongoDB and It has happened something really weird. I didn't lose anything valuable. But I definitely need to know what happened in order to avoid it to happen again, when I DO have something important.

I had created 2 small databases and had also shut down and restarted mongod several times. No problem.

However, I accidentally quit Hyper (bash) without closing the server. So I went back to bash, and killed the task with the following line with admin permission:

$ taskkill //PID 3628 //F

It finished the process. And then I was able to restart the mongo server and keep working. But when I did all the databases were gone!

So, it looks to me like pretty obvious that it was due to the unclean shutdown, but cannot find anything documented about it. Except for this short line in the Mongo Documentation:

"In a clean shutdown a mongod completes all pending operations, flushes all data to data files, and closes all data files. Other shutdowns are unclean and can compromise the validity of the data files."

Just wondering if any of you have ever experienced this, and just to confirm that this actually happened to me because I killed the process from the console or if you think there might be another reason.

Thank a lot!

P/S: working with NodeJS, Hyper (gitbash), MongoDB last ver., local.

💖 💪 🙅 🚩
nanythery
Nadine M. Thêry

Posted on July 3, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related