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

CSDC: integrate with osd-zfs compression

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • 3
    • 9223372036854775807

      On osd-zfs, osd_write_prep() is a no-op and osd_bufs_get_write() hands out ARC zero-copy buffers without reading any existing data. The OST read-modify-write of a compressed chunk depends on that read: ofd_map_chunks_to_lnb_write() calls is_chunk_start() on the first page of the chunk after dt_write_prep(). On ZFS that page has never been read, so the chunk looks uncompressed, the merge is skipped, and the partial write is stored plain over the compressed image. The chunk is then unreadable.

      ofd_decompress_chunk() has the same shape of dependency, collecting source pages with PageUptodate(). The code already notes "XXX: uptodate is not zfs-friendly, need another means".

      Since ZFS supports data compression natively, I think the best approach to integrating CSDC with osd-zfs would be to integrate CSDC to provide compressed data blocks that match ZFS's on-disk compressed blocks natively, rather than writing/reading CSDC data straight through to the ZFS backend. That might need some massaging of ll_compr_hdr for osd-zfs, and translating the compression algorithm numbering to match what ZFS uses internally, and then bypassing the ZFS compression engine to provide already-compressed data to ZFS in some manner. Other than the chunk headers and the compression algorithm numbering, I expect that the CSDC compressed data chunks will match the ZFS compressed data exactly.

      We might need a new API to be able to write compressed data chunks directly to ZFS (as we would for passing pre-checksummed data blocks to ZFS. That may have been implemented for the Uni Hamburg work originally, but I'm not sure. Hopefully this would allow client-side compressed blocks to be written directly to ZFS data blocks without copying every byte of data on the OSS, but an initial implementation might keep the osd-ldiskfs CSDC wire protocol intact and rejig the format to match ZFS with "only" a data copy to align it with the ZFS on-disk format instead of decompressing and recompressing it.

            wc-triage WC Triage
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: