db.fsyncLock() and snapshots

Hello,

I am making a plan for upgrading my Replica Set from v4.2 to v5.0.

I want to know if it is possible to take snapshots of my Replica Set after having stopped writes to the database using db.fsyncLock() . When I say take snapshots, I mean navigating to the Backup tab in the dashboard for my cluster and then clicking TAKE SNAPSHOT NOW.

Thank you !

Any help about this would be much appreciated.

From what I can gather from the docs: db.fsyncLock() , it seems like this should not be a problem.

You should not need to use fsyncLock to take a snapshot but you have to have journaling on, and on the same filesystem (and snapshot all the files, data and journal).

Have you reviewed this page in the docs: MongoDB Backup Methods — MongoDB Manual?

2 Likes

I believe that journaling is enabled as we are currently taking regular scheduled snapshots.

I was asking more in general if it is still possible to take snapshots if one has used db.fsyncLock() .

The reason that I was thinking of doing this is to guarantee that the snapshot taken is exactly the same state as the database was before fsyncLock was used and so that no more writes to the database could be performed during the upgrade.

The situation I am trying to mitigate against is if something goes wrong during the upgrade, I want the snapshot that we recover the database from to be in the same state as before we started the upgrade.