`xl.meta` is a new self describing backend format used by MinIO to support AWS S3 compatible versioning. This file is the source of truth for each `version` at rest. `xl.meta` is a msgpack file serialized from a well defined data structure. To understand `xl.meta` here are the few things to start with
├─ 0379f361-695c-4509-b0b8-a4842d414579
│ └─ part.1
├─ 804fea2c-c21e-490b-98ff-cdb647047cb6
│ └─ part.1
├─ e063d138-4d6e-4e68-8576-12d1b4509cc3
│ └─ part.1
├─ e675c1f6-476d-4b46-be31-281c887aea7b
│ └─ part.1
└─ xl.meta
/mnt/data03/engineering/backup.tar.gz
`xl.meta` carries first 8 bytes an XL header which describes the current format and the format version, allowing the unmarshaller's to automatically use the right data structures to parse the subsequent content in the stream.
├─ 0379f361-695c-4509-b0b8-a4842d414579
│ └─ part.1
├─ 804fea2c-c21e-490b-98ff-cdb647047cb6
│ └─ part.1
├─ e063d138-4d6e-4e68-8576-12d1b4509cc3
│ └─ part.1
├─ e675c1f6-476d-4b46-be31-281c887aea7b
│ └─ part.1
└─ xl.meta
/mnt/data04/engineering/backup.tar.gz
These are the current entries
├─ 0379f361-695c-4509-b0b8-a4842d414579
```go
│ └─ part.1
var (
├─ 804fea2c-c21e-490b-98ff-cdb647047cb6
// XL header specifies the format
│ └─ part.1
// one extra byte left for future use
├─ e063d138-4d6e-4e68-8576-12d1b4509cc3
xlHeader = [4]byte{'X', 'L', '2', ' '}
│ └─ part.1
├─ e675c1f6-476d-4b46-be31-281c887aea7b
│ └─ part.1
└─ xl.meta
/mnt/data05/engineering/backup.tar.gz
// XLv2 version 1 specifies the current
├─ 0379f361-695c-4509-b0b8-a4842d414579
// version of the XLv2 format, 3 extra bytes
│ └─ part.1
// left for future use.
├─ 804fea2c-c21e-490b-98ff-cdb647047cb6
xlVersionV1 = [4]byte{'1', ' ', ' ', ' '}
│ └─ part.1
)
├─ e063d138-4d6e-4e68-8576-12d1b4509cc3
│ └─ part.1
├─ e675c1f6-476d-4b46-be31-281c887aea7b
│ └─ part.1
└─ xl.meta
```
```
`xl.meta` is a msgpack file with following data structure, this is converted from binary format to JSON for convenience.
Once the header is validated, we proceed to the actual data structure of the `xl.meta` format. `xl.meta` carries three types of object entries which designate the type of version object stored.
- ObjectType (default)
- LegacyObjectType (preserves existing deployments and older xl.json format)
- DeleteMarker (a versionId to capture the DELETE sequences implemented primarily for AWS spec compatibility)
A sample msgpack-JSON `xl.meta`, you can debug the content inside `xl.meta` using [xl-meta-to-json.go][./xl-meta-to-json.go] program.
- All Buckets on MinIO are always in one of the following states: unversioned (the default), versioning-enabled, or versioning-suspended.
- All Buckets on MinIO are always in one of the following states: unversioned (the default) and all other existing deployments, versioning-enabled, or versioning-suspended.
- Versioning state applies to all of the objects in the versioning enabled bucket. The first time you enable a bucket for versioning, objects in the bucket are thereafter always versioned and given a unique version ID.
- Versioning state applies to all of the objects in the versioning enabled bucket. The first time you enable a bucket for versioning, objects in the bucket are thereafter always versioned and given a unique version ID.
- Existing or newer buckets can be created with versioning enabled and eventually can be suspended as well. Existing versions of objects stay as is and can still be accessed using the version ID.
- Existing or newer buckets can be created with versioning enabled and eventually can be suspended as well. Existing versions of objects stay as is and can still be accessed using the version ID.
- All versions, including delete-markers should be deleted before deleting a bucket.
- All versions, including delete-markers should be deleted before deleting a bucket.