Files not touched in weeks got truncated after a crash
Hi,
We are having some trouble with one of our fileservers using XFS (on linux). Yesterday, one of the external RAIDs on the server failed. Of course, it is unavoidable that some data would get lost from the fileserver in such an event, however, we lost a lot more files than would seem reasonable. In particular, we lost a number of files that had not been written to (but had been been read from, in some cases) in several weeks.
The data loss manifested itself through files being truncated to length 0 or to some other size short of what they should be. (We happen to have an external database that keeps track of that.)
The fileserver is based on CentOS 6.3 with kernel version 2.6.32-279.9.1.el6.x86_64. It has got several external RAIDs in the 100 TB range, connected via FibreChannel.
In case it matters: The server's primary role is as a samba server servicing a large number of Windows XP and Windows 7 machines.
We had already been trying to reduce the possible impact of a hardware failure by setting a few tunables in /etc/sysctl.conf to try and make the kernel not keep dirty buffers around too long:
vm.dirty_background_bytes = 536870912
vm.dirty_bytes = 134217728
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 3000
and by issuing a sync from cron every 15 minutes:
0,15,30,45 * * * * /bin/sync
Unfortunately, I seem to be unable so far to reproduce the issue on a smaller system - and I cannot exactly just walk up to the in-production fileserver and rip out yet another array just to see what happens...
This leaves me with a few questions:
Why did we lose so much data through the crash?
Why did not even a sync every 15 minutes prevent further damage?
What can we do to prevent this from happening again in the future?
Regards,
Guido
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 41 lines · Guido Winkelmann
Hi,
We are having some trouble with one of our fileservers using XFS (on linux). Yesterday, one of the external RAIDs on the server failed. Of course, it is unavoidable that some data would get lost from the fileserver in such an event, however, we lost a lot more files than would seem reasonable. In particular, we lost a number of files that had not been written to (but had been been read from, in some cases) in several weeks.
The data loss manifested itself through files being truncated to length 0 or to some other size short of what they should be. (We happen to have an external database that keeps track of that.)
The fileserver is based on CentOS 6.3 with kernel version 2.6.32-279.9.1.el6.x86_64. It has got several external RAIDs in the 100 TB range, connected via FibreChannel.
In case it matters: The server's primary role is as a samba server servicing a large number of Windows XP and Windows 7 machines.
We had already been trying to reduce the possible impact of a hardware failure by setting a few tunables in
/etc/sysctl.confto try and make the kernel not keep dirty buffers around too long:vm.dirty_background_bytes = 536870912
vm.dirty_bytes = 134217728
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 3000and by issuing a sync from cron every 15 minutes:
0,15,30,45 * * * *
/bin/syncUnfortunately, I seem to be unable so far to reproduce the issue on a smaller system - and I cannot exactly just walk up to the in-production fileserver and rip out yet another array just to see what happens...
This leaves me with a few questions:
Why did we lose so much data through the crash?
Quoted 7 lines
Why did not even a sync every 15 minutes prevent further damage?
What can we do to prevent this from happening again in the future?
Regards,
Guido
Syncing won't protect you from hardware failures.
Without more details about what happened to the external RAID and what you did to recover it's impossible to answer your question.
--
Roger
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 1 line · On Wednesday 13 November 2013 16:51:44 Roger Willcocks wrote:
Syncing won't protect you from hardware failures.
Obviously not, but it might - should, I would argue - lessen the impact of one.
Quoted 2 lines
Without more details about what happened to the external RAID and what you did to recover it's impossible to answer your question.
Well, if I understood the admin correctly, the backplane in the RAID in question died, probably from a short-circuit on the board. (But I think that latter part was just speculation.) He removed the harddisks from that enclosure, put them into another one of the same make and model, mirrored over the configuration from the broken to the working one and reattached it to the server. The server was shut down in the mean time.
Guido
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
You should update your kernel - this sounds like an issue that Dave fixed quite a few months back (and got shipped in RHEL and other distros, I don't know about when Centos would pick it up)
Ric
Quoted 45 lines · Guido Winkelmann
Hi,
We are having some trouble with one of our fileservers using XFS (on linux). Yesterday, one of the external RAIDs on the server failed. Of course, it is unavoidable that some data would get lost from the fileserver in such an event, however, we lost a lot more files than would seem reasonable. In particular, we lost a number of files that had not been written to (but had been been read from, in some cases) in several weeks.
The data loss manifested itself through files being truncated to length 0 or to some other size short of what they should be. (We happen to have an external database that keeps track of that.)
The fileserver is based on CentOS 6.3 with kernel version 2.6.32-279.9.1.el6.x86_64. It has got several external RAIDs in the 100 TB range, connected via FibreChannel.
In case it matters: The server's primary role is as a samba server servicing a large number of Windows XP and Windows 7 machines.
We had already been trying to reduce the possible impact of a hardware failure by setting a few tunables in
/etc/sysctl.confto try and make the kernel not keep dirty buffers around too long:vm.dirty_background_bytes = 536870912
vm.dirty_bytes = 134217728
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 3000and by issuing a sync from cron every 15 minutes:
0,15,30,45 * * * *
/bin/syncUnfortunately, I seem to be unable so far to reproduce the issue on a smaller system - and I cannot exactly just walk up to the in-production fileserver and rip out yet another array just to see what happens...
This leaves me with a few questions:
Why did we lose so much data through the crash?
Why did not even a sync every 15 minutes prevent further damage?
What can we do to prevent this from happening again in the future?
Quoted 8 lines
Regards,
Guido
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Ric Wheeler
You should update your kernel - this sounds like an issue that Dave fixed quite a few months back (and got shipped in RHEL and other distros, I don't know about when Centos would pick it up)
It's in the CentOS 6.4 kernel, according to the release notes:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/6.4_Technical_Notes/kernel.html
(BZ#855139)
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · On Wednesday 13 November 2013 22:43:23 Stefan Ring wrote:
Quoted 3 lines · Ric Wheeler
You should update your kernel - this sounds like an issue that Dave fixed quite a few months back (and got shipped in RHEL and other distros, I don't know about when Centos would pick it up)
It's in the CentOS 6.4 kernel, according to the release notes:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6
/html/6.4_Technical_Notes/kernel.html (BZ#855139)
Hm, this could be it, but it still sounds a bit unlikely.
The bug description implies that the filesystem would have to have been idling from the point where the affected files were written until the point of the system crash (or unclean unmount), such that the old, and by that time incorrect, metadata updates would still linger in the journal, but that was not really the case here. The filesystem was quite busy during those weeks....
Also, the bug report speaks only of zero-length files, while many of our files had been truncated to lengths other than zero.
Guido
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs