Skip to content

[irmin-pack] dangling hash when using contents other than string #2369

@eWert-Online

Description

@eWert-Online

I had a look into irmin-pack (currently I am using irmin-fs.unix), but I wasn't able to get it running reliably.
I am using the following configuration:

module Contents = struct
  type t =
    { name : string
    ; deck : string list
    ; reveal : [ `Everyone | `SpectatorsOnly ]
    }
  [@@deriving irmin]

  let merge = Irmin.Merge.(option (idempotent t))
end

module Conf = struct
  let entries = 32
  let stable_hash = 256
  let contents_length_header = Some `Varint
  let inode_child_order = `Seeded_hash
  let forbid_empty_dir_persistence = true
end

module Repo_config = struct
  let index_log_size = 2_500_000
  let merge_throttle = `Block_writes
  let indexing_strategy = Irmin_pack.Indexing_strategy.minimal
  let root = Filename.concat (Sys.getcwd ()) "db"
  let fresh = false

  let config =
    Irmin_pack.config ~fresh ~index_log_size ~merge_throttle ~indexing_strategy root
  ;;
end

module StoreMaker = Irmin_pack_unix.KV (Conf)
module Store = StoreMaker.Make (Contents)

Inserting data seems to be fine, but trying to read them again, yields the error message:
Irmin.Tree.to_concrete: encountered dangling hash ab6a424af22507531d8e3ca6e98e5a885773b19f40743213ab5e55c7a8289360c6717881db7af0b7ff39e1b225d9e015605b5612de7d0c84fc5c6cc3d67df4e9.

When I switch the contents to be Irmin.Contents.String everything is working.
Does irmin-pack only support string contents?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions