File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,13 +116,20 @@ const init = (config) => {
116116
117117 const objectNameFor = ( { id, sha } ) => {
118118 // Include blob ID in object name to allow easy correlation with postgres data.
119+ //
119120 // Include blob SHA sum to prevent name collision in case multiple odk-central-
120121 // backend instances point to the same bucket. There are a few scenarios where
121122 // this could happen, e.g.
122123 //
123124 // * instance reset after testing/training
124125 // * staging & prod instances pointed to the same bucket
125126 // * temporary loss of access to postgres data on upgrade error
127+ //
128+ // To allow restoring from backups, do NOT include:
129+ //
130+ // * S3 server URL
131+ // * bucket name
132+
126133 if ( typeof id !== 'number' ) throw new Error ( 'Invalid id: ' + id ) ;
127134 if ( ! sha ) throw new Error ( 'Missing sha sum for blob: ' + id ) ;
128135 return `${ objectPrefix ?? '' } blob-${ id } -${ sha } ` ;
You can’t perform that action at this time.
0 commit comments