[pbs-devel] [PATCH v4 proxmox-backup 2/2] backup: check all referenced chunks actually exist

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Sep 15 09:42:15 CEST 2020


On 9/15/20 8:09 AM, Dietmar Maurer wrote:
> unrelated question below:
> 
>  /// Ensure all chunks referenced in this backup actually exist.
>> +    /// Only call *after* all writers have been closed, to avoid race with GC.
>> +    /// In case of error, mark the previous backup as 'verify failed'.
>> +    fn verify_chunk_existance(&self, known_chunks: &KnownChunksMap) -> Result<(), Error> {
>> +        for (digest, (_, checked)) in known_chunks.iter() {
>> +            if !checked && !self.datastore.chunk_path(digest).0.exists() {
>> +                let mark_msg = if let Some(ref last_backup) = self.last_backup {
>> +                    let last_dir = &last_backup.backup_dir;
>> +                    let verify_state = SnapshotVerifyState {
>> +                        state: "failed".to_owned(),
> 
> Why is state a String? This should be an enum instead? Please can you take a look at that? 

It really should be an enum, no idea why I did not made it one to begin with.





More information about the pbs-devel mailing list