Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SERVER-79010: after we reopen wiredtiger_open, we shold close the old connection #1562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ void WiredTigerKVEngine::_openWiredTiger(const std::string& path, const std::str
"This version of MongoDB is too recent to start up on the existing data files. "
"Try MongoDB 4.2 or earlier.");
}
invariantWTOK(_conn->close(_conn, nullptr), nullptr);

// MongoDB 4.4 doing clean shutdown in FCV 4.2 will use compatibility version 3.3.
configStr = wtOpenConfig + ",compatibility=(require_min=\"3.3.0\")";
Expand All @@ -682,6 +683,7 @@ void WiredTigerKVEngine::_openWiredTiger(const std::string& path, const std::str
_fileVersion = {WiredTigerFileVersion::StartupVersion::IS_44_FCV_42};
return;
}
invariantWTOK(_conn->close(_conn, nullptr), nullptr);

// MongoDB 4.2 uses compatibility version 3.2.
configStr = wtOpenConfig + ",compatibility=(require_min=\"3.2.0\")";
Expand Down Expand Up @@ -709,6 +711,7 @@ void WiredTigerKVEngine::_openWiredTiger(const std::string& path, const std::str
LOGV2_FATAL_NOTRACE(
28595, "Terminating.", "reason"_attr = wtRCToStatus(ret, nullptr).reason());
}
invariantWTOK(_conn->close(_conn, nullptr), nullptr);

// Always attempt to salvage metadata regardless of error code when in repair mode.
LOGV2_WARNING(22349, "Attempting to salvage WiredTiger metadata");
Expand Down