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

creating/breaking mirror should not change file timestamps

Details

    • Improvement
    • Resolution: Not a Bug
    • Minor
    • None
    • Lustre 2.12.6
    • None
    • 3
    • 9223372036854775807

    Description

      When a file is mirrored and the mirrored is broken file time stamps should be preserved. Here we see that ctime and mtime change to the mirror creation time.

      Initial File:

       # stat testfile
        File: 'testfile'
        Size: 59535     	Blocks: 120        IO Block: 4194304 regular file
      Device: 521e79ech/1377729004d	Inode: 342273918398214817  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2022-02-14 15:48:45.000000000 -0800
      Modify: 2022-02-14 15:48:45.000000000 -0800
      Change: 2022-02-14 15:48:45.000000000 -0800
      

       
      Now we mirror

       # date; lfs mirror extend -N S 1M -c 1 -p hdd-pool testfile
      Mon Feb 14 15:50:27 PST 2022
      

      State the File and layout

      # stat testfile
        File: 'testfile'
        Size: 59535     	Blocks: 120        IO Block: 4194304 regular file
      Device: 521e79ech/1377729004d	Inode: 342273918398214817  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2022-02-14 15:48:45.000000000 -0800
      Modify: 2022-02-14 15:48:45.000000000 -0800
      Change: 2022-02-14 15:48:45.000000000 -0800
       Birth: -
      pfe25 /nobackupp18/mhanafi # lfs getstripe testfile
      testfile
        lcm_layout_gen:    1
        lcm_mirror_count:  2
        lcm_entry_count:   4
          lcme_id:             65537
          lcme_mirror_id:      1
          lcme_flags:          init,prefer
          lcme_extent.e_start: 0
          lcme_extent.e_end:   268435456
            lmm_stripe_count:  1
            lmm_stripe_size:   16777216
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 109
            lmm_pool:          ssd-pool
            lmm_objects:
            - 0: { l_ost_idx: 109, l_fid: [0x90000040a:0x53990:0x0] }
      
          lcme_id:             65538
          lcme_mirror_id:      1
          lcme_flags:          prefer
          lcme_extent.e_start: 268435456
          lcme_extent.e_end:   5368709120
            lmm_stripe_count:  -1
            lmm_stripe_size:   16777216
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: -1
            lmm_pool:          ssd-pool
      
          lcme_id:             65539
          lcme_mirror_id:      1
          lcme_flags:          0
          lcme_extent.e_start: 5368709120
          lcme_extent.e_end:   EOF
            lmm_stripe_count:  16
            lmm_stripe_size:   16777216
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: -1
            lmm_pool:          hdd-pool
      
          lcme_id:             131073
          lcme_mirror_id:      2
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   EOF
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 0
            lmm_pool:          hdd-pool
            lmm_objects:
            - 0: { l_ost_idx: 0, l_fid: [0x2c0000409:0x30c3e:0x0] }
      
      

      Break the mirror and stat the file. File ctime and atime has changed.

      date; lfs mirror split -d --mirror-id 1 testfile
      Mon Feb 14 15:51:31 PST 2022
      
       # stat testfile
        File: 'testfile'
        Size: 59535     	Blocks: 120        IO Block: 4194304 regular file
      Device: 521e79ech/1377729004d	Inode: 342273918398214817  Links: 1
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2022-02-14 15:50:27.000000000 -0800
      Modify: 2022-02-14 15:48:45.000000000 -0800
      Change: 2022-02-14 15:50:27.000000000 -0800
       Birth: -
      

      Attachments

        Issue Links

          Activity

            [LU-15557] creating/breaking mirror should not change file timestamps
            cfaber Colin Faber added a comment -

            Hi mhanafi after some discussion with the developers, this behavior is as designed specifically desirable with the creation of new mirrors.

            cfaber Colin Faber added a comment - Hi mhanafi after some discussion with the developers, this behavior is as designed specifically desirable with the creation of new mirrors.
            cfaber Colin Faber added a comment -

            Hi mhanafi,

            We're still discussing this, because the blocks change on disk, ctime should change (according to POSIX standard), this is expected behavior, (if the blocks don't change, this patch will prevent ctime updates).

            Because of this we need to discuss how to deliver this with (possibly) a configuration option to turn on and off this behavior.

            -cf

            cfaber Colin Faber added a comment - Hi mhanafi , We're still discussing this, because the blocks change on disk, ctime should change (according to POSIX standard), this is expected behavior, (if the blocks don't change, this patch will prevent ctime updates). Because of this we need to discuss how to deliver this with (possibly) a configuration option to turn on and off this behavior. -cf

            can we get a back port to 2.12.6_ddn and 2.14?

            mhanafi Mahmoud Hanafi added a comment - can we get a back port to 2.12.6_ddn and 2.14?
            cfaber Colin Faber added a comment -

            Hi mhanafi,

            LU-14508 should address this and will be availeble in the 2.15 release.

            -cf

            cfaber Colin Faber added a comment - Hi mhanafi , LU-14508 should address this and will be availeble in the 2.15 release. -cf

            Some users track file time stamps and expect them not to change. 

            mhanafi Mahmoud Hanafi added a comment - Some users track file time stamps and expect them not to change. 
            jhammond John Hammond added a comment -

            Generally mirror split will change the block count and therefore should update the ctime. Do you have some workflow or application that is affected by the ctime update?

            jhammond John Hammond added a comment - Generally mirror split will change the block count and therefore should update the ctime. Do you have some workflow or application that is affected by the ctime update?

            lustre server/client 2.12.7

            mhanafi Mahmoud Hanafi added a comment - lustre server/client 2.12.7
            cfaber Colin Faber added a comment -

            Hi,

            What version are you running?

            -cf

            cfaber Colin Faber added a comment - Hi, What version are you running? -cf

            People

              cfaber Colin Faber
              mhanafi Mahmoud Hanafi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: