-
Notifications
You must be signed in to change notification settings - Fork 3
Versioning
Krishna Srinivas edited this page Jul 20, 2018
·
3 revisions
versionID is of the time stamp format 2018-07-19T23-54-03.470361222Z
Sample flow and backend structure: bucket-name is "documents" object-name is "hello.txt"
- Object versioning not enabled. User does a PutObject
backend on disk1:
krishna@escape:~$ tree export-xl/disk1/documents/
export-xl/disk1/documents/
└── hello.txt
├── part.1
└── xl.json
1 directory, 2 files
krishna@escape:~$
- User enables versioning on the bucket
krishna@escape:~$ emacs export-xl/disk1/.minio.sys/buckets/documents/versioning.json/
part.1 xl.json
krishna@escape:~$
Contents of the versioning.json file:
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Status>Enabled</Status>
</VersioningConfiguration>
- User does PutObject of hello.txt
backend on disk1:
krishna@escape:~/export-xl/disk1/documents$ tree .
.
├── hello.txt
│ ├── part.1
│ └── xl.json
└── hello.txt.versions
└── 0
├── part.1
└── xl.json
3 directories, 4 files
krishna@escape:~/export-xl/disk1/documents$
The hello.txt/
got renamed to hello.txt.versions/0
The newly uploaded hello.txt's xl.json will contain VersionID: 2018-07-20T01-41-19.342Z
- User does PutObject of hello.txt again:
backend on disk1:
krishna@escape:~/export-xl/disk1/documents$ tree .
.
├── hello.txt
│ ├── part.1
│ └── xl.json
└── hello.txt.versions
├── 0
│ ├── part.1
│ └── xl.json
└── 2018-07-20T01-41-19.342Z
├── part.1
└── xl.json
4 directories, 6 files
krishna@escape:~/export-xl/disk1/documents$
The hello.txt/
got renamed to hello.txt.versions/2018-07-20T01-41-19.342Z
2018-07-20T01-41-19.342Z
is the versionId
- User does a get on
hello.txt?versionId=2018-07-20T01-41-19.342Z
we can translate it to hello.txt.versions/2018-07-20T01-41-19.342Z
- User does a get on
hello.txt?versionId=null
we can translate it to hello.txt.versions/0
- User does a delete on
hello.txt?versionId=2018-07-20T01-41-19.342Z
we can delete hello.txt.versions/2018-07-20T01-41-19.342Z
Note: there will be no support for DeleteMarkers