Module Upper.V3

type from_v1_v2_post_upgrade = {
  1. entry_offset_at_upgrade_to_v3 : Optint.Int63.t;
}

entry_offset_at_upgrade_to_v3 is the offset of the first entry that is known to have been created using irmin_pack_version = `V2 or more. The entries before that point may be v1 entries. V1 entries need an entry in index because it is the only place their lenght is stored.

val from_v1_v2_post_upgrade_t : from_v1_v2_post_upgrade Irmin.Type.t
type from_v3_gced = {
  1. suffix_start_offset : Optint.Int63.t;
  2. generation : int;
}

suffix_start_offset is 0 if the suffix file was never garbage collected. Otherwise it is the offset of the very first entry of the suffix file. Note that offsets in the suffix file are virtual. The garbage collections don't reset the offsets.

generation is the number of past GCs. A suffix file, a prefix file and a mapping containing that integer in their filename exist.

val from_v3_gced_t : from_v3_gced Irmin.Type.t
type status =
  1. | From_v1_v2_post_upgrade of from_v1_v2_post_upgrade
  2. | From_v3_no_gc_yet
  3. | From_v3_used_non_minimal_indexing_strategy
  4. | From_v3_gced of from_v3_gced
  5. | T1
  6. | T2
  7. | T3
  8. | T4
  9. | T5
  10. | T6
  11. | T7
  12. | T8
  13. | T9
  14. | T10
  15. | T11
  16. | T12
  17. | T13
  18. | T14
  19. | T15

From_v1_v2_post_upgrade corresponds to a pack store that was upgraded to `V3. It contains infos related to backward compatibility. GCs are forbidden on it.

From_v3_no_gc_yet corresponds to a pack store that was created using `V3 code. It never underwent a GC.

From_v3_used_non_minimal_indexing_strategy corresponds to a pack store that was created using `V3 code. It never underwent a GC and it will never be possible to GC it because entries were pushed using a non-minimal indexing strategy.

From_v3_gced is a store that was GCed at least once.

The T* tags are provisional tags that the binary decoder is aware of and that may in the future be used to add features to the `V3 payload.

val status_t : status Irmin.Type.t
type t = {
  1. dict_end_poff : Optint.Int63.t;
  2. suffix_end_poff : Optint.Int63.t;
  3. status : status;
}

The `V3 payload of the irmin-pack control file. `V3 is a major version. If `V4 ever exists, it will have its own dedicated payload, but the `V3 definition will still have to stick in the codebase for backward compatibilty of old pack stores.

A store may only change its major version during an open_rw in File_manager. Note that upgrading a major version is the only reason why open_rw would modify files in an irmin-pack directory.

For a given major version, the format of a payload may change, but only in a backward compatible way. I.e., all versions of irmin-pack should forever be able to decode a `V3 control file, it allows for control file corruption and out-of-date code to be distinguishable.

It is legal for the payload decoder to not fully consume the input buffer. Remaining bytes means that the definition of a payload was changed.

Fields

dict_end_poff is the offset in the dict file just after the last valid dict bytes. The next data to be pushed to the dict will be pushed at this offset.

suffix_end_poff is similar to dict_end_poff but for the suffix file.

status is a variant that encode the state of the irmin-pack directory. This field MUST be the last field of the record, in order to allow extensions

val t : t Irmin.Type.t