[SERVER-2129] Database file timestamp is never updated... Created: 21/Nov/10  Updated: 29/Aug/11  Resolved: 04/Apr/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.6.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Fred Stluka Assignee: Mathias Stearn
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux Fedora Core 8, running on AWS EC2 32-bit server.
Also, Linux Fedora 13, running on AWS EC2 64-bit server.


Operating System: Linux
Participants:

 Description   

The timestamp of the database file never changes, even if writes are done to the DB, and even if the DB server is stopped and restarted.

This is a problem because it appears that the file has not changed, so utilities like rsync are fooled into not backing up the file.

Problem occurs on:

  • Linux Fedora Core 8, running on AWS EC2 32-bit server.
  • Linux Fedora 13, running on AWS EC2 64-bit server.

Works fine (timestamp IS updated) on Mac OS X 10.6.5 (Snow Leopard)

--Fred Stluka



 Comments   
Comment by Mathias Stearn [ 11/Apr/11 ]

I know it is fixed as of 2.6.32 at the very latest. If needed I can see if we have any boxes with older kernels to test on.

Comment by Fred Stluka [ 09/Apr/11 ]

Eliot,

I was asking what Linux kernel versions it is fixed in, since Mathias said it
is "Fixed in new kernels", not what MongoDB version.

Thanks!
--Fred

Comment by Fred Stluka [ 04/Apr/11 ]

Mathias,

Do you know what kernel versions it is fixed in?

Thanks!
--Fred

Comment by Mathias Stearn [ 04/Apr/11 ]

Linux kernel bug. Fixed in newer kernels.

Comment by Fred Stluka [ 23/Nov/10 ]

Mathias,

Thanks for the suggestion. I suspect rsync would run much slower with --checksum, and I'm backing up a large directory tree with relatively few modified files, so I need the speed.

My current workaround is to "touch" each MongoDB file before the rsync, since I know that the DB files are going to change every day anyhow. Then they DO get backed up.

Let me know what you find...

Thanks!
--Fred

Comment by Mathias Stearn [ 22/Nov/10 ]

For now you can force rsync to ignore the modified date by using the --checksum option. I'm looking into why the modified date isn't getting updated.

Comment by Fred Stluka [ 22/Nov/10 ]

Eliot,

Great! So the problem is reproducible. That's a good first step towards resolving it. Let me know if there's anything else I can do to help.

--Fred

Comment by Eliot Horowitz (Inactive) [ 22/Nov/10 ]

ubuntu 10.4 ext4 - DID change
fedora 8 ext3 - did NOT change

Comment by Fred Stluka [ 22/Nov/10 ]

Eliot,

Not sure how to interpret your last comment.

The mod time DID change on Ubuntu 10.4 ext4, right?
Did it change or not on Fedora 8 ext3?

--Fred

Comment by Eliot Horowitz (Inactive) [ 22/Nov/10 ]

Quick test

Ubuntu 10.04 ext4 - file mod time update
Fedora 8 ext3

Not entirely sure where to go from here...

We're certainly not changing anything.

Comment by Fred Stluka [ 22/Nov/10 ]

Eliot,

Here are the relevant /etc/fstab lines on both servers where I see this problem:

/dev/sdf /ebs ext3 defaults 0 0

/dev/sdf /ebs ext3 defaults,acl 0 0

I only have the 2 servers, and the problem occurs on both. In both cases, the /ebs drive is mounted on a device that is an Amazon EBS drive backed by Amazon S3 storage.

I'm setting up a new server soon that will also use Amazon EBS backed by S3, but will use the ext4 filesystem. No other relevant differences, I think.

We also use MongoDB on our Mac laptops, and the dates are updated there as expected.

What systems do you have for development and testing? Does this perhaps happen with all Linux systems? I've used lots of Linux systems, but MongoDB may be the first app I've used that does memory mapped I/O, so I don't know whether this is standard behavior for memory mapped files on Linux.

--Fred

Comment by Eliot Horowitz (Inactive) [ 22/Nov/10 ]

Usually but i've seen weird things.

Can you send the fstab entry?

We don't do anything special in the code for this, so its something at file system/os layer.

Comment by Fred Stluka [ 22/Nov/10 ]

No. /etc/fstab does NOT specify noatime.

Even if it did, doesn't that have to do only with reads of the file, not writes? Even if it were set, the timestamp would be updated when the file was written. True?

--Fred Stluka

Comment by Eliot Horowitz (Inactive) [ 22/Nov/10 ]

This is likely a system configuration.

Do you have noatime set in fstab?

Generated at Thu Feb 08 02:59:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.