diff --git a/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp b/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp
index 3c185d4985..af71c007e0 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp
@@ -48,8 +48,12 @@
 #include "mongo/db/storage/write_unit_of_work.h"
 #include "mongo/executor/task_executor.h"
 #include "mongo/logv2/log.h"
+#include "mongo/logv2/log_debug.h"
 #include "mongo/s/grid.h"
 #include "mongo/stdx/mutex.h"
+#include "mongo/util/fail_point.h"
+
+MONGO_FAIL_POINT_DEFINE(hangBeforeConsumingOplogEntries);
 
 namespace mongo {
 namespace {
@@ -110,6 +114,16 @@ Future<void> ReshardingOplogFetcher::awaitInsert(const ReshardingDonorOplogId& l
     // being issued.
 
     stdx::lock_guard lk(_mutex);
+
+    auto future = _fetchedFinishPromise.makePromiseFutureImpl().future;
+    if (future.isReady()) {
+        try {
+            future.get();
+        } catch (DBException& ex) {
+            logd("xxx error: {}", ex.toString());
+        }
+    }
+
     if (lastSeen < _startAt) {
         // `lastSeen < _startAt` means there's at least one document which has been inserted by
         // ReshardingOplogFetcher and hasn't been returned by
@@ -125,6 +139,7 @@ Future<void> ReshardingOplogFetcher::awaitInsert(const ReshardingDonorOplogId& l
     // `lastSeen > _startAt` isn't expected to happen in practice because
     // ReshardingDonorOplogIterator only uses _id's from documents that it actually read from the
     // oplog buffer collection for `lastSeen`, but would also mean the caller wants to wait.
+    logd("xxx gonna move the future");
     return std::move(_onInsertFuture);
 }
 
@@ -181,10 +196,17 @@ bool ReshardingOplogFetcher::iterate(Client* client) {
             return true;
         }
         targetShard = swDonor.getValue();
+
+        if (MONGO_unlikely(hangBeforeConsumingOplogEntries.shouldFail())) {
+            logd("xxx hit the failpoint");
+            hangBeforeConsumingOplogEntries.pauseWhileSet(opCtxRaii.get());
+        }
     }
 
     try {
-        return consume(client, targetShard.get());
+        bool res = consume(client, targetShard.get());
+        logd("xxx returned from consume without error");
+        return res;
     } catch (const ExceptionForCat<ErrorCategory::Interruption>&) {
         return false;
     } catch (const ExceptionFor<ErrorCodes::OplogQueryMinTsMissing>&) {
@@ -256,6 +278,12 @@ AggregationRequest ReshardingOplogFetcher::_makeAggregationRequest(Client* clien
 bool ReshardingOplogFetcher::consume(Client* client, Shard* shard) {
     _ensureCollection(client, _toWriteInto);
 
+    if (client->getKilled()) {
+        logd("xxx intercept killed client to return status that will throw");
+        Status status{ErrorCodes::OplogQueryMinTsMissing, "xxx throw an error"};
+        throw status;
+    }
+
     auto aggRequest = _makeAggregationRequest(client);
 
     auto opCtxRaii = client->makeOperationContext();
diff --git a/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp
index df950d5154..4dd7d6bb62 100644
--- a/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp
+++ b/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp
@@ -51,6 +51,7 @@
 #include "mongo/db/service_context.h"
 #include "mongo/db/session_catalog_mongod.h"
 #include "mongo/db/storage/write_unit_of_work.h"
+#include "mongo/logv2/log_debug.h"
 #include "mongo/s/catalog/sharding_catalog_client_mock.h"
 #include "mongo/s/catalog/type_shard.h"
 #include "mongo/unittest/unittest.h"
@@ -489,5 +490,79 @@ TEST_F(ReshardingOplogFetcherTest, TestAwaitInsert) {
     ASSERT_FALSE(fetcher.awaitInsert({dataWriteTimestamp, dataWriteTimestamp}).isReady());
 }
 
+TEST_F(ReshardingOplogFetcherTest, TestAwaitInsertErrors) {
+    const NamespaceString outputCollectionNss("dbtests.outputCollection");
+    const NamespaceString dataCollectionNss("dbtests.runFetchIteration");
+
+    create(outputCollectionNss);
+    create(dataCollectionNss);
+    _fetchTimestamp = repl::StorageInterface::get(_svcCtx)->getLatestOplogTimestamp(_opCtx);
+
+    const auto& collectionUUID = [&] {
+        AutoGetCollection dataColl(_opCtx, dataCollectionNss, LockMode::MODE_IX);
+        return dataColl->uuid();
+    }();
+
+    ReshardingDonorOplogId startAt{_fetchTimestamp, _fetchTimestamp};
+    ReshardingOplogFetcher fetcher(_reshardingUUID,
+                                   collectionUUID,
+                                   startAt,
+                                   _donorShard,
+                                   _destinationShard,
+                                   true,
+                                   outputCollectionNss);
+
+    // The ReshardingOplogFetcher hasn't inserted a record for
+    // {_id: {clusterTime: _fetchTimestamp, ts: _fetchTimestamp}} so awaitInsert(startAt) won't be
+    // immediately ready.
+
+    // iterate() won't lead to any documents being inserted into the output collection (because no
+    // writes have happened to the data collection) so `hasSeenStartAtFuture` still won't be ready.
+    auto fetcherJob = launchAsync([&, this] {
+        ThreadClient tc("RunnerForFetcher", _svcCtx, nullptr);
+        fetcher.useReadConcernForTest(false);
+        fetcher.setInitialBatchSizeForTest(2);
+        return fetcher.iterate(&cc());
+    });
+    ASSERT_TRUE(requestPassthroughHandler(fetcherJob));
+
+    // Insert a document into the data collection and have it generate an oplog entry with a
+    // "destinedRecipient" field. Only after iterate() is called again and inserts a record into the
+    // output collection will `hasSeenStartAtFuture` have become ready.
+    std::ignore = [&] {
+        FailPointEnableBlock fp("addDestinedRecipient",
+                                BSON("destinedRecipient" << _destinationShard.toString()));
+
+        AutoGetCollection dataColl(_opCtx, dataCollectionNss, LockMode::MODE_IX);
+        WriteUnitOfWork wuow(_opCtx);
+        insertDocument(dataColl.getCollection(), InsertStatement(BSON("_id" << 1 << "a" << 1)));
+        wuow.commit();
+
+        repl::StorageInterface::get(_opCtx)->waitForAllEarlierOplogWritesToBeVisible(_opCtx);
+        return repl::StorageInterface::get(_svcCtx)->getLatestOplogTimestamp(_opCtx);
+    }();
+
+    auto hasSeenStartAtFuture = fetcher.awaitInsert(startAt);
+
+    logd("xxx going to kill the client");
+
+    {
+        FailPointEnableBlock failpoint("hangBeforeConsumingOplogEntries");
+        fetcherJob = launchAsync([&, this] {
+            ThreadClient tc("RunnerForFetcher", _svcCtx, nullptr);
+            fetcher.useReadConcernForTest(false);
+            fetcher.setInitialBatchSizeForTest(2);
+            return fetcher.iterate(&cc());
+        });
+
+        failpoint->waitForTimesEntered(failpoint.initialTimesEntered() + 1);
+        cc().setKilled();
+    }
+
+    sleep(3);
+    auto newFuture = fetcher.awaitInsert(startAt);
+    ASSERT_TRUE(newFuture.isReady());
+}
+
 }  // namespace
 }  // namespace mongo
