storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/docs/bucket/versioning/DESIGN.md (about) 1 # Bucket Versioning Design Guide [](https://slack.min.io) [](https://hub.docker.com/r/minio/minio/) 2 3 ## Description of `xl.meta` 4 5 `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 6 7 `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. 8 9 These are the current entries 10 ```go 11 var ( 12 // XL header specifies the format 13 // one extra byte left for future use 14 xlHeader = [4]byte{'X', 'L', '2', ' '} 15 16 // XLv2 version 1 specifies the current 17 // version of the XLv2 format, 3 extra bytes 18 // left for future use. 19 xlVersionV1 = [4]byte{'1', ' ', ' ', ' '} 20 ) 21 ``` 22 23 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. 24 25 - ObjectType (default) 26 - LegacyObjectType (preserves existing deployments and older xl.json format) 27 - DeleteMarker (a versionId to capture the DELETE sequences implemented primarily for AWS spec compatibility) 28 29 A sample msgpack-JSON `xl.meta`, you can debug the content inside `xl.meta` using [xl-meta.go](https://github.com/minio/minio/blob/master/docs/bucket/versioning/xl-meta.go) program. 30 ```json 31 { 32 "Versions": [ 33 { 34 "Type": 1, 35 "V2Obj": { 36 "ID": "KWUs8S+8RZq4Vp5TWy6KFg==", 37 "DDir": "X3pDAFu8Rjyft7QD6t7W5g==", 38 "EcAlgo": 1, 39 "EcM": 2, 40 "EcN": 2, 41 "EcBSize": 10485760, 42 "EcIndex": 3, 43 "EcDist": [ 44 3, 45 4, 46 1, 47 2 48 ], 49 "CSumAlgo": 1, 50 "PartNums": [ 51 1 52 ], 53 "PartETags": [ 54 "" 55 ], 56 "PartSizes": [ 57 314 58 ], 59 "PartASizes": [ 60 282 61 ], 62 "Size": 314, 63 "MTime": 1591820730, 64 "MetaSys": { 65 "X-Minio-Internal-Server-Side-Encryption-S3-Kms-Key-Id": "bXktbWluaW8ta2V5", 66 "X-Minio-Internal-Server-Side-Encryption-S3-Kms-Sealed-Key": "ZXlKaFpXRmtJam9pUVVWVExUSTFOaTFIUTAwdFNFMUJReTFUU0VFdE1qVTJJaXdpYVhZaU9pSkJMMVZzZFVnelZYVjZSR2N6UkhGWUwycEViRmRCUFQwaUxDSnViMjVqWlNJNklpdE9lbkJXVWtseFlWSlNVa2t2UVhNaUxDSmllWFJsY3lJNklrNDBabVZsZG5WU1NWVnRLMFoyUWpBMVlYTk9aMU41YVhoU1RrNUpkMDlhTkdKa2RuaGpLMjFuVDNnMFFYbFJhbE15V0hkU1pEZzNRMk54ZUN0SFFuSWlmUT09", 67 "X-Minio-Internal-Server-Side-Encryption-Seal-Algorithm": "REFSRXYyLUhNQUMtU0hBMjU2", 68 "X-Minio-Internal-Server-Side-Encryption-Iv": "bW5YRDhRUGczMVhkc2pJT1V1UVlnbWJBcndIQVhpTUN1dnVBS0QwNUVpaz0=", 69 "X-Minio-Internal-Server-Side-Encryption-S3-Sealed-Key": "SUFBZkFPeUo5ZHVVSEkxYXFLU0NSRkJTTnM0QkVJNk9JWU1QcFVTSXFhK2dHVThXeE9oSHJCZWwwdnRvTldUNE8zS1BtcWluR0cydmlNNFRWa0N0Mmc9PQ==" 70 }, 71 "MetaUsr": { 72 "content-type": "application/octet-stream", 73 "etag": "20000f00f58c508b40720270929bd90e9f07b9bd78fb605e5432a67635fc34722e4fc53b1d5fab9ff8400eb9ded4fba2" 74 } 75 } 76 } 77 ] 78 } 79 ```