Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-16298

periodically write ldiskfs superblock

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • Lustre 2.16.0
    • None
    • 9223372036854775807

    Description

      The ext4 superblock has an "s_kbytes_written" field that is supposed to contain the total number of bytes written to the block device since the filesystem was formatted. The in-memory counter that tracks the current number of writes written to the block device is exposed to userspace via /sys/fs/{ldiskfs,ext4}/<device>/session_kbytes_written, and this is added to s_kbytes_written to generate the "lifetime" writes and shown at .../lifetime_kbytes_written. This would be useful for tracking the total lifetime writes on flash OST and MDT devices, assuming they are not reformatted during usage (which should be rare). The in-memory block device writes counter is written to disk via ext4_update_super().

      Unfortunately, upstream ext4 after commit v3.5-rc5-19-g4d47603d9703 no longer writes out the superblock on any regular basis. The superblock is only written at unmount/remount time, in case ext4_error() is hit, or if the filesystem is resized or frozen, which means that the s_kbytes_written counter may frequently be inaccurate due to missing updates if the filesystem is not unmounted cleanly each time (e.g. due to crash/reboot/STONITH).

      Having a periodic write of the superblock (e.g. once per hour, or other tunable interval) would not add any measurable overhead to the system, but ensure that the s_kbytes_written counter is kept relatively well updated, so at most an hour worth of writes would be lost in case of a crash and remount.

      Attachments

        Issue Links

          Activity

            [LU-16298] periodically write ldiskfs superblock
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-16982 [ LU-16982 ]
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.16.0 [ 15190 ]
            Resolution New: Fixed [ 1 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
            pjones Peter Jones added a comment -

            Landed for 2.16

            pjones Peter Jones added a comment - Landed for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51340/
            Subject: LU-16298 ldiskfs: Periodically write ldiskfs superblock
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: e27a7b33d6351ff8b8bae101079af88f4eedac99

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51340/ Subject: LU-16298 ldiskfs: Periodically write ldiskfs superblock Project: fs/lustre-release Branch: master Current Patch Set: Commit: e27a7b33d6351ff8b8bae101079af88f4eedac99
            vkuznetsov Vitaliy Kuznetsov made changes -
            Status Original: Open [ 1 ] New: In Progress [ 3 ]
            adilger Andreas Dilger made changes -
            Link New: This issue is related to EX-5996 [ EX-5996 ]

            "Vitaliy Kuznetsov <vkuznetsov@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51340
            Subject: LU-16298 ldiskfs: Periodically write ldiskfs superblock
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 018987285af2c40f9fcb1a0008e5d9283658dd7d

            gerrit Gerrit Updater added a comment - "Vitaliy Kuznetsov <vkuznetsov@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51340 Subject: LU-16298 ldiskfs: Periodically write ldiskfs superblock Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 018987285af2c40f9fcb1a0008e5d9283658dd7d
            pjones Peter Jones made changes -
            Link New: This issue is related to EX-7677 [ EX-7677 ]
            cfaber Colin Faber made changes -
            Assignee Original: WC Triage [ wc-triage ] New: Vitaliy Kuznetsov [ vkuznetsov ]
            adilger Andreas Dilger made changes -
            Labels New: ldiskfs

            People

              vkuznetsov Vitaliy Kuznetsov
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: