Question

I perform fsync() operation in MongoDB, but it just returns immediately. It doesn't appear to have done anything. How do I verify if the data has indeed been flushed to disk at all?

NOTE: I set syncdelay to 0 which means that the writes won't be automatically fsync'ed every 60 seconds.

my actual command is using the perl driver:

$connection->fsync({async=>1});

Thanks.

Was it helpful?

Solution

If you don't want the fsync to return immediately, then you can remove the async option and it will become a blocking operation.

But if you don't want it to be blocking, you can use db.currentOp from the shell to query the current state of the fsync.

If you want to get that information from Perl, you can use the technique I outlined in this answer. Unfortunately there's no convenient way to get it directly via run_command.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top