diff options
author | Yu Jin Kang Park <yujin.kang@mongodb.com> | 2022-03-11 08:53:28 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-11 09:20:29 +0000 |
commit | 0492ea43ae52b6102e6637b0cd745a2901e6bf06 (patch) | |
tree | a5c84f5dbc2bd050ceaabecd90327d1cd0bad609 | |
parent | a00fb5cf43aa8ed985998bc634d8c9afdf5c74a3 (diff) | |
download | mongo-0492ea43ae52b6102e6637b0cd745a2901e6bf06.tar.gz |
SERVER-64025 Initialize wtRet and add non-zero check
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 5817b9c9291..1fd9045d955 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -1068,7 +1068,7 @@ public: StatusWith<std::vector<BackupBlock>> getNextBatch(OperationContext* opCtx, const std::size_t batchSize) { - int wtRet; + int wtRet = 0; std::vector<BackupBlock> backupBlocks; stdx::lock_guard<Latch> backupCursorLk(_wtBackup->wtBackupCursorMutex); @@ -1136,7 +1136,7 @@ public: } } - if (wtRet != WT_NOTFOUND && backupBlocks.size() != batchSize) { + if (wtRet && wtRet != WT_NOTFOUND && backupBlocks.size() != batchSize) { return wtRCToStatus(wtRet, _session); } |