Replace ModelVersion.hash with ETag
https://redmine.teklia.com/issues/11341
-
The
ModelVersion.hashfield is removed. -
The
ModelVersion.check_hashmethod is removed. There are no server-side checks on thehashor thearchive_hash, those will only be made after downloading a model version. -
A new
ModelVersion.s3_etagfield is added instead, as a nullableCharFieldof up to 50 characters. It cannot be accessed or edited through the API. It is editable in the Django admin. This is the rawETagheader returned by S3 with no processing at all. -
The
s3_etagfield should be set automatically froms3_object.e_tag:- When the
stateis set toAvailablethroughUpdateModelVersion; - When the
stateis set toAvailablethroughPartialUpdateModelVersion; - When
CompleteMultipartUploadsucceeds on a ModelVersion and will update itsstatetoAvailable.
- When the
-
❌ A newarkindex check_modelversionsmanagement command should, for each ModelVersion that isAvailable:- Call
s3_object.load(); - If it fails because the object doesn't exist, show a warning and skip;
- If it fails for any other reason, show an error and skip;
- If the
s3_etagwasNone, set it to thes3_object.e_tag; - If the
s3_etagwas set and it is different from thes3_object.e_tag, show a warning.
- Call
-
✅ Thearkindex cleanupcommand should perform the check throughListObjectsinstead of callingHeadObjectonce per ModelVersion.