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

lfs getstripe --yaml should use an array for components

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      For composite files lfs getstripe --yaml uses a key for each component rather than an array:

      $ lfs getstripe --yaml f0
        lcm_layout_gen:    1
        lcm_mirror_count:  2
        lcm_entry_count:   2
        component0:
          lcme_id:             65537
          lcme_mirror_id:      1
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   EOF
          sub_layout:
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 2
            lmm_objects:
            - l_ost_idx: 2
              l_fid:     0x100020000:0xd1:0x0
      
        component1:
          lcme_id:             131073
          lcme_mirror_id:      2
          lcme_flags:          init
          lcme_extent.e_start: 0
          lcme_extent.e_end:   EOF
          sub_layout:
            lmm_stripe_count:  1
            lmm_stripe_size:   1048576
            lmm_pattern:       raid0
            lmm_layout_gen:    0
            lmm_stripe_offset: 3
            lmm_objects:
            - l_ost_idx: 3
              l_fid:     0x100030000:0xd1:0x0
      
      

      Using "components

      {0...}

      " instead of any array is poor YAML style and hinders the use of the output with common YAML tooling. If an array ("components") was used instead of numbered keys then we could do things like:

      lfs getstripe --yaml f0 | yq '.components[] | select(.lcme_flags == "init,stale")'
      

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: