rhel7: sar/sa file is broken after the force termination of the system

Solution Verified - Updated -

Issue

After the force termination of the customer's system, sa file is broken and the following message is output by sar command:

End of system activity file unexpected

But the sa file isn't broken on the other system due to the same event, even if the system is terminated forcibly. The broken sa file is experienced on RHEL7.4, ext4 file system, sysstat-10.1.5-12.el7. On this combination, the sa file gets not corrupted: RHEL6.5, ext3 file system, sysstat-9.0.4-22.el6_5.1 .

We investigated the source code of sysstat. As a result, sadc calls fdatasync() on RHEL6 before it closes sa file
but it doesn't call any systemcall to sync on RHEL7 before it closes sa file. Therefore, we think that the sysstat on RHEL7 has following problems:

  • The records on disk cache are lost if the system is terminated forcibly before the disk cache of sa file isn't synchronized to the disk.
  • sa file gets broken if the system is terminated forcibly while the disk cache is being synchronized to the disk.

We judged that the following fix makes the above differences for sysstat's behavior.
We understand that this fix removes the sync process of sadc because it put a pain on flash devices.

Clliped from "CHANGES" in sysstat src package.


2010/05/23: Version 9.1.2 - Sebastien Godard
* sadc no longer syncs data with its output file contents. It
put a pain on flash devices as it undermined any tuning of
the vm's write behavior [DEBIAN Bug#559686].


But this fix leads the above problems. As written in the Debian Bug report, sadc should be choice to sync or not sync via command line option.

Environment

  • Red Hat Enterprise Linux 7, minor versions before 7.7
  • sysstat

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content