diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-01-29 10:56:15 -0500 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-01-29 14:57:34 -0500 |
commit | d9295a2e55339b19430390371902325a5837f50e (patch) | |
tree | 643273858d45a4cc4bd00b5df3c02f17bb37ab3d /src | |
parent | 3e4d4d6c8839eea43df01d1eb25de2979f88606c (diff) | |
download | mongo-d9295a2e55339b19430390371902325a5837f50e.tar.gz |
SERVER-32453 Handle cursor->next return code in WTKVEngine::getAllIdents
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index f9f9bdf3cb5..22c4befe68a 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -931,12 +931,13 @@ bool WiredTigerKVEngine::_hasUri(WT_SESSION* session, const std::string& uri) co std::vector<std::string> WiredTigerKVEngine::getAllIdents(OperationContext* opCtx) const { std::vector<std::string> all; + int ret; WiredTigerCursor cursor("metadata:", WiredTigerSession::kMetadataTableId, false, opCtx); WT_CURSOR* c = cursor.get(); if (!c) return all; - while (c->next(c) == 0) { + while ((ret = c->next(c)) == 0) { const char* raw; c->get_key(c, &raw); StringData key(raw); @@ -954,6 +955,8 @@ std::vector<std::string> WiredTigerKVEngine::getAllIdents(OperationContext* opCt all.push_back(ident.toString()); } + fassert(50663, ret == WT_NOTFOUND); + return all; } |