From fa13cf699646836b464d02aa29109ae9933c99fb Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 4 May 2020 13:30:42 +0000 Subject: [PATCH] Repair: do not mark deleted when upstream object is not found With the previous behaviour, repairing could see some data as absent and decide that the object or version was deleted, thus going on to delete the version and blocks. In the case where read_quorum + write_quorum <= replication_factor however, entries may not yet be returned by the get, thus data would have been deleted that should hot have been. The new behavior is more cautious and just skips the entry when the warning is emitted. --- src/garage/repair.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/garage/repair.rs b/src/garage/repair.rs index f2ca64ae..afea61de 100644 --- a/src/garage/repair.rs +++ b/src/garage/repair.rs @@ -112,10 +112,10 @@ impl Repair { .any(|x| x.uuid == version.uuid && x.state != ObjectVersionState::Aborted), None => { warn!( - "Repair versions: object for version {:?} not found", + "Repair versions: object for version {:?} not found, skipping.", version ); - false + continue; } }; if !version_exists { @@ -158,10 +158,10 @@ impl Repair { Some(v) => !v.deleted, None => { warn!( - "Block ref repair: version for block ref {:?} not found", + "Block ref repair: version for block ref {:?} not found, skipping.", block_ref ); - false + continue; } }; if !ref_exists {