A FreeBSD user reported a problem with doing a force receive of a full stream
(non-incremental) while using a debug build:

panic: solaris assert: dbuf_is_metadata(db) == arc_is_metadata(buf) (0x0 == 0x1)
assfail3()
dbuf_assign_arcbuf()
dmu_assign_arcbuf()
receive_writer_thread()

Here is a corresponding write record header:
  header = {
    drr_type = DRR_WRITE,
    drr_payloadlen = 0,
    drr_u = {
...
      drr_write = {
        drr_object = 357,
        drr_type = DMU_OT_DIRECTORY_CONTENTS,
        drr_pad = 0,
        drr_offset = 0,
        drr_logical_size = 512,
        drr_toguid = 6461692233939371501,
        drr_checksumtype = 2 '\002',
        drr_checksumflags = 0 '\000',
        drr_compressiontype = 0 '\000',
        drr_pad2 = "\000\000\000\000",
        drr_key = {
          ddk_cksum = {
            zc_word = {0, 0, 0, 0}
          },
          ddk_prop = 0
        },
        drr_compressed_size = 0
      },


Here is the ARC header:
$6 = {
  b_dva = {
    dva_word = {0, 0}
  },
  b_birth = 0,
  b_type = ARC_BUFC_METADATA,
  b_hash_next = 0x0 <avl_balance2child>,
  b_flags = (ARC_FLAG_BUFC_METADATA | ARC_FLAG_HAS_L1HDR |
ARC_FLAG_COMPRESSED_ARC | ARC_FLAG_SHARED_DATA | ARC_FLAG_COMPRESS_1),
  b_psize = 1,
  b_lsize = 1,
  b_spa = 7546455437792279428,
...

Here is the dnode:
  dn_objset = 0xfffff800815f1800,
  dn_object = 357,
  dn_dbuf = 0xfffff800826da6b8,
  dn_handle = 0xfffff800815ca208,
  dn_phys = 0xfffffe0002d1aa00,
  dn_type = DMU_OT_PLAIN_FILE_CONTENTS,
  dn_bonuslen = 204,
  dn_bonustype = 44 ',',
  dn_nblkptr = 1 '\001',
  dn_checksum = 0 '\000',
  dn_compress = 0 '\000',
  dn_nlevels = 1 '\001',
  dn_indblkshift = 17 '\021',
  dn_datablkshift = 9 '\t',
  dn_moved = 0 '\000',
  dn_datablkszsec = 1,
  dn_datablksz = 512,
  dn_maxblkid = 0,
  dn_next_type = "\000\000\000",
  dn_next_nblkptr = "\000\000\000",
  dn_next_nlevels = "\000\000\000",
  dn_next_indblkshift = "\000\000\000\021",
  dn_next_bonustype = "\000\000\000,",
  dn_rm_spillblk = "\000\000\000",
  dn_next_bonuslen = {0, 0, 0, 204},
  dn_next_blksz = {0, 0, 0, 512},
  dn_dbufs_count = 2,
  dn_allocated_txg = 199719,
  dn_free_txg = 0,
  dn_assigned_txg = 199719,
  dn_dirtyctx = DN_DIRTY_OPEN,

tx_txg = 199719 as well.

The problem started happening after the compressed send / receive feature was
introduced.  But the feature was not used when the crash happened.

I think that that being a force receive we are probably changing the object type
to a different one (from a plain file to a directory), but something goes wrong
with that.  Alternatively, maybe there is an issue with setting
drr_write.drr_type on the sender side.
I think that previously we didn't verify that drr_write.drr_type matches actual
dn_type, so the problem could be obscured.

Do you have any suggestions?
Thank you!

-- 
Andriy Gapon

------------------------------------------
openzfs-developer
Archives: https://openzfs.topicbox.com/groups/developer/
Powered by Topicbox: https://topicbox.com

Reply via email to