checkpoint transactionのcompletion evidenceをrestart-bearing fileの置換前に無効化する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | out_dir |
subroutine begin_checkpoint_publish(out_dir) character(len=*), intent(in) :: out_dir character(len=1024) :: path, temporary_path integer :: u, ios, rename_status path = trim(out_dir)//'/'//checkpoint_manifest_name temporary_path = trim(path)//'.tmp' open (newunit=u, file=trim(temporary_path), status='replace', action='write', iostat=ios) if (ios /= 0) error stop 'Failed to create temporary checkpoint manifest.' write (u, '(a,i0)') 'schema_version=', checkpoint_manifest_schema_current write (u, '(a)') 'state=in_progress' close (u, iostat=ios) if (ios /= 0) error stop 'Failed to close temporary checkpoint manifest.' call atomic_rename(trim(temporary_path), trim(path), rename_status) if (rename_status /= filesystem_success) error stop 'Failed to invalidate checkpoint manifest.' end subroutine begin_checkpoint_publish