4 title: Using collection versioning
8 Copyright (C) The Arvados Authors. All rights reserved.
10 SPDX-License-Identifier: CC-BY-SA-3.0
13 Collection versioning (if enabled system-wide) adds the possibility to store different collection states as it is modified. Depending on the cluster configuration it can work automatically, but there's also a way to manually control it by the user.
15 Versioning only triggers when selected collection attributes are updated: @name@, @description@, @properties@ and @manifest_text@.
16 When one of these attributes change and the cluster-wide's configured collection idle time is up, or the individual collection's @preserve_version@ attribute is @true@, a new copy is made before saving the changes.
18 Every collection has a @version@ attribute that indicates its version number, starting from 1 on new collections and incrementing by 1 with every versionable update. Also, all collections point to their most current version via the @current_version_uuid@ attribute.
20 h3. Accessing past versions of a collection
22 To request a particular collection with all its versions you should request a list with filters including the collection's UUID and passing the @include_old_versions@ query parameter. For example, using the @arv@ command line client:
25 $ arv collection index --filters '[["uuid", "=", "o967z-4zz18-ynmlhyjbg1arnr2"]]' --include-old-versions
27 "kind":"arvados#collectionList",
34 "href":"/collections/o967z-4zz18-i3ucessyo6xxadt",
35 "kind":"arvados#collection",
36 "etag":"7bhgspoi4rg9d33o925y8k277",
37 "uuid":"o967z-4zz18-i3ucessyo6xxadt",
38 "owner_uuid":"o967z-tpzed-dvuag6geduje1ub",
39 "created_at":"2018-10-05T14:43:38.916885000Z",
40 "modified_by_client_uuid":"o967z-ozdt8-ac1bob2unkhev15",
41 "modified_by_user_uuid":"o967z-tpzed-dvuag6geduje1ub",
42 "modified_at":"2018-10-05T14:44:31.098019000Z",
43 "name":"Test collection",
44 "description":"This is the first version",
46 "portable_data_hash":"d41d8cd98f00b204e9800998ecf8427e+0",
47 "replication_desired":null,
48 "replication_confirmed":null,
49 "replication_confirmed_at":null,
50 "storage_classes_desired":[
53 "storage_classes_confirmed":[],
54 "storage_classes_confirmed_at":null,
59 "current_version_uuid":"o967z-4zz18-ynmlhyjbg1arnr2",
60 "preserve_version":true
63 "href":"/collections/o967z-4zz18-ynmlhyjbg1arnr2",
64 "kind":"arvados#collection",
65 "etag":"1b995we7yilwyh7sc0w746urv",
66 "uuid":"o967z-4zz18-ynmlhyjbg1arnr2",
67 "owner_uuid":"o967z-tpzed-dvuag6geduje1ub",
68 "created_at":"2018-10-05T14:43:38.916885000Z",
69 "modified_by_client_uuid":"o967z-ozdt8-ac1bob2unkhev15",
70 "modified_by_user_uuid":"o967z-tpzed-dvuag6geduje1ub",
71 "modified_at":"2018-10-05T14:44:31.078643000Z",
72 "name":"Test collection",
73 "description":"This is the second (and current) version",
75 "portable_data_hash":"d41d8cd98f00b204e9800998ecf8427e+0",
76 "replication_desired":null,
77 "replication_confirmed":null,
78 "replication_confirmed_at":null,
79 "storage_classes_desired":[
82 "storage_classes_confirmed":[],
83 "storage_classes_confirmed_at":null,
88 "current_version_uuid":"o967z-4zz18-ynmlhyjbg1arnr2",
89 "preserve_version":false
96 You can also access a past version directly by its UUID:
99 $ arv collection get --uuid o967z-4zz18-i3ucessyo6xxadt
101 "href":"/collections/o967z-4zz18-i3ucessyo6xxadt",
102 "kind":"arvados#collection",
103 "etag":"1ej4d9klu70bez72cy7yjrz7o",
104 "uuid":"o967z-4zz18-i3ucessyo6xxadt",
105 "owner_uuid":"o967z-tpzed-dvuag6geduje1ub",
106 "created_at":"2018-10-05T14:43:38.916885000Z",
107 "modified_by_client_uuid":"o967z-ozdt8-ac1bob2unkhev15",
108 "modified_by_user_uuid":"o967z-tpzed-dvuag6geduje1ub",
109 "modified_at":"2018-10-05T14:44:31.098019000Z",
110 "name":"Test collection",
111 "description":"This is the first version",
113 "portable_data_hash":"d41d8cd98f00b204e9800998ecf8427e+0",
115 "replication_desired":null,
116 "replication_confirmed":null,
117 "replication_confirmed_at":null,
118 "storage_classes_desired":[
121 "storage_classes_confirmed":[],
122 "storage_classes_confirmed_at":null,
127 "current_version_uuid":"o967z-4zz18-ynmlhyjbg1arnr2",
128 "preserve_version":true
132 h3. Manually preserving a version
134 Regardless of the collection's auto-save idle time cluster configuration, the user has the option to request that a particular collection state should be preserved.
136 When working on a collection, if there's a need to preserve the current state as a new version, the @preserve_version@ attribute should be set to @true@. This will trigger a new version creation on the next update, keeping this "version 2" state as a snapshot.
139 $ arv collection update --uuid o967z-4zz18-ynmlhyjbg1arnr2 -c '{"preserve_version":true}'
141 "href":"/collections/o967z-4zz18-ynmlhyjbg1arnr2",
142 "kind":"arvados#collection",
143 "etag":"8vhdwnahk8jcr84mqitmd5stu",
144 "uuid":"o967z-4zz18-ynmlhyjbg1arnr2",
145 "owner_uuid":"o967z-tpzed-dvuag6geduje1ub",
146 "created_at":"2018-10-05T14:43:38.916885000Z",
147 "modified_by_client_uuid":"o967z-ozdt8-ac1bob2unkhev15",
148 "modified_by_user_uuid":"o967z-tpzed-dvuag6geduje1ub",
149 "modified_at":"2018-10-05T15:12:57.986454000Z",
150 "name":"Test collection",
151 "description":"This is the second (and current) version",
153 "portable_data_hash":"d41d8cd98f00b204e9800998ecf8427e+0",
155 "replication_desired":null,
156 "replication_confirmed":null,
157 "replication_confirmed_at":null,
158 "storage_classes_desired":[
161 "storage_classes_confirmed":[],
162 "storage_classes_confirmed_at":null,
167 "current_version_uuid":"o967z-4zz18-ynmlhyjbg1arnr2",
168 "preserve_version":true
172 Once the @preserve_version@ attribute is set to @true@, it cannot be manually changed to @false@ and it will only be reset when a versionable update on the collection triggers a new version snapshot.
174 h3. Collection versions behavior & limitations
176 Past version collections are read-only, if you need to make changes to one of them, the suggested approach is to copy it into a new collection before updating.
178 Some attributes get automatically synced when they change on the current version:
184 * @replication_desired@
185 * @storage_classes_desired@
187 This way, old versions follow the current one on several configurations. In the special case that a current version's UUID gets updated, their past versions get also updated to point to the newer UUID.
189 Permissions on past versions are the same as their current version, the system does not allow attaching permission links to old versions. If you need to give special access to someone to a particular old version, the correct procedure is by copying it as a new collection.