summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
commit959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch)
treeacc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
parent76588293975fc059cf076779e4283e6ffaf8afff (diff)
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 97bf1fc8557..0de1c43284f 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -1173,11 +1173,22 @@ private:
int wtRet;
bool fileUnchangedFlag = false;
if (!_wtBackup->dupCursor) {
- wtRet = (_session)->open_cursor(
- _session, nullptr, _wtBackup->cursor, config.c_str(), &_wtBackup->dupCursor);
- if (wtRet != 0) {
- return wtRCToStatus(wtRet, _session);
- }
+ size_t attempt = 0;
+ do {
+ wtRet = _session->open_cursor(
+ _session, nullptr, _wtBackup->cursor, config.c_str(), &_wtBackup->dupCursor);
+
+ if (wtRet == EBUSY) {
+ logAndBackoff(8927900,
+ ::mongo::logv2::LogComponent::kStorage,
+ logv2::LogSeverity::Debug(1),
+ ++attempt,
+ "Opening duplicate backup cursor returned EBUSY, retrying",
+ "config"_attr = config);
+ } else if (wtRet != 0) {
+ return wtRCToStatus(wtRet, _session);
+ }
+ } while (wtRet == EBUSY);
fileUnchangedFlag = true;
}
@@ -1310,12 +1321,15 @@ WiredTigerKVEngine::beginNonBlockingBackup(OperationContext* opCtx,
for (const DurableCatalog::Entry& e : catalogEntries) {
// Populate the collection ident with its namespace and UUID.
UUID uuid = catalog->getMetaData(opCtx, e.catalogId)->options.uuid.get();
- _wtBackup.identToNamespaceAndUUIDMap.emplace(e.ident, std::make_pair(e.nss, uuid));
+ std::string collectionIdent = e.ident;
+ _wtBackup.identToNamespaceAndUUIDMap.emplace(collectionIdent,
+ std::make_pair(e.nss, uuid));
// Populate the collection's index idents with the collection's namespace and UUID.
std::vector<std::string> idxIdents = catalog->getIndexIdents(opCtx, e.catalogId);
- for (const std::string& idxIdent : idxIdents) {
- _wtBackup.identToNamespaceAndUUIDMap.emplace(idxIdent, std::make_pair(e.nss, uuid));
+ for (const std::string& idxIdentFull : idxIdents) {
+ _wtBackup.identToNamespaceAndUUIDMap.emplace(idxIdentFull,
+ std::make_pair(e.nss, uuid));
}
}
}