File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,31 @@ function _markObjectPending(
150150 return next ( ) ;
151151 }
152152
153+ // Initialize replication info, if missing
154+ if ( ! objMD . getReplicationInfo ( )
155+ || ! objMD . getReplicationSiteStatus ( storageClass ) ) {
156+ const { Rules, Role } = repConfig ;
157+ const destination = Rules [ 0 ] . Destination . Bucket ;
158+ // set replication properties
159+ const ops = objMD . getContentLength ( ) === 0 ? [ 'METADATA' ]
160+ : [ 'METADATA' , 'DATA' ] ;
161+ const backends = [ {
162+ site : storageClass ,
163+ status : 'PENDING' ,
164+ dataStoreVersionId : '' ,
165+ } ] ;
166+ const replicationInfo = {
167+ status : 'PENDING' ,
168+ backends,
169+ content : ops ,
170+ destination,
171+ storageClass,
172+ role : Role ,
173+ storageType : STORAGE_TYPE ,
174+ } ;
175+ objMD . setReplicationInfo ( replicationInfo ) ;
176+ }
177+
153178 objMD . setReplicationSiteStatus ( storageClass , 'PENDING' ) ;
154179 objMD . setReplicationStatus ( 'PENDING' ) ;
155180 objMD . updateMicroVersionId ( ) ;
You can’t perform that action at this time.
0 commit comments