From 6d58064964f44eff53a7ecbc4741640d40c57e27 Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Wed, 9 Sep 2020 06:46:08 -0700 Subject: [PATCH] Buggify _parsePartitionedLogFileOnLoader with blob http error --- fdbserver/RestoreCommon.actor.cpp | 26 +++++++++++++------------- fdbserver/RestoreLoader.actor.cpp | 13 +++++++++++++ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/fdbserver/RestoreCommon.actor.cpp b/fdbserver/RestoreCommon.actor.cpp index f78a067768..a40163c362 100644 --- a/fdbserver/RestoreCommon.actor.cpp +++ b/fdbserver/RestoreCommon.actor.cpp @@ -312,6 +312,19 @@ ACTOR Future>> decodeLogFileBlock(Referenceread(mutateString(buf), len, offset)); if (rLen != len) throw restore_bad_read(); + if (BUGGIFY && deterministicRandom()->random01() < 0.01) { // Simulate blob failures + double i = deterministicRandom()->random01(); + if (i < 0.5) { + throw http_request_failed(); + } else if (i < 0.7) { + throw connection_failed(); + } else if (i < 0.8) { + throw timed_out(); + } else if (i < 0.9) { + throw lookup_failed(); + } + } + Standalone> results({}, buf.arena()); state StringRefReader reader(buf, restore_corrupted_data()); @@ -337,19 +350,6 @@ ACTOR Future>> decodeLogFileBlock(Referencerandom01() < 0.01) { // Simulate blob failures - double i = deterministicRandom()->random01(); - if (i < 0.5) { - throw http_request_failed(); - } else if (i < 0.7) { - throw connection_failed(); - } else if (i < 0.8) { - throw timed_out(); - } else if (i < 0.9) { - throw lookup_failed(); - } - } - return results; } catch (Error& e) { diff --git a/fdbserver/RestoreLoader.actor.cpp b/fdbserver/RestoreLoader.actor.cpp index 366a8ba5ac..ace9174e44 100644 --- a/fdbserver/RestoreLoader.actor.cpp +++ b/fdbserver/RestoreLoader.actor.cpp @@ -353,6 +353,19 @@ ACTOR static Future _parsePartitionedLogFileOnLoader( int rLen = wait(file->read(mutateString(buf), asset.len, asset.offset)); if (rLen != asset.len) throw restore_bad_read(); + if (BUGGIFY && deterministicRandom()->random01() < 0.01) { // Simulate blob failures + double i = deterministicRandom()->random01(); + if (i < 0.5) { + throw http_request_failed(); + } else if (i < 0.7) { + throw connection_failed(); + } else if (i < 0.8) { + throw timed_out(); + } else if (i < 0.9) { + throw lookup_failed(); + } + } + TraceEvent("FastRestoreLoaderDecodingLogFile") .detail("BatchIndex", asset.batchIndex) .detail("Filename", asset.filename)