Mongodb

mongorestore 期間 MongoDB 中的斷言失敗 _state.get() 錯誤

  • October 12, 2017

我想說我是 mongodb 的新手,今天我試圖恢復轉儲文件。我在我的 mongod 中得到了轉儲Assertion failure _state.get()期間mongorestore,當時程序卡住了。mongodb環境如下:

Mongodb version is - 3.2.16-11-g1abb660
O.S - Windows 7 Enterprise 32-bit
mongodb is running in Domain account.

當我從我的發送以下restore轉儲日誌時mongod

2017-10-11T12:40:22.994+0300 I -        [conn11] Assertion failure _state.get() < 0 C:\data\mci\89fbcdee7b6a486969190f06feaabe28\src\src\mongo/util/concurrency/rwlock.h 204
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\util\log.cpp(136)                                                  mongo::logContext+0xba
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\util\assert_util.cpp(137)                                          mongo::verifyFailed+0x17e
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\mmap_windows.cpp(164)                           mongo::MemoryMappedFile::close+0x5a
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\mmap_windows.cpp(340)                           mongo::MemoryMappedFile::map+0x800
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\durable_mapped_file.cpp(261)                    mongo::DurableMappedFile::create+0x137
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\data_file.cpp(175)                              mongo::DataFile::open+0x167
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\mmap_v1_extent_manager.cpp(241)                 mongo::MmapV1ExtentManager::_addAFile+0x175
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\mmap_v1_extent_manager.cpp(393)                 mongo::MmapV1ExtentManager::_createExtent+0x8d
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\mmap_v1_extent_manager.cpp(497)                 mongo::MmapV1ExtentManager::allocateExtent+0x93
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\record_store_v1_base.cpp(528)                   mongo::RecordStoreV1Base::increaseStorageSize+0x2f
   2017-10-11T12:40:23.693+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\record_store_v1_simple.cpp(169)                 mongo::SimpleRecordStoreV1::allocRecord+0x28a
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\record_store_v1_base.cpp(353)                   mongo::RecordStoreV1Base::_insertRecord+0x8d
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\mmap_v1\record_store_v1_base.cpp(342)                   mongo::RecordStoreV1Base::insertRecord+0x145
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\storage\record_store.h(379)                                     mongo::RecordStore::insertRecords+0x6a
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\catalog\collection.cpp(443)                                     mongo::Collection::_insertDocuments+0x20b
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\catalog\collection.cpp(361)                                     mongo::Collection::insertDocuments+0x248
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\catalog\collection.cpp(378)                                     mongo::Collection::insertDocument+0x73
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands\write_commands\batch_executor.cpp(1048)                mongo::insertOne+0x155
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands\write_commands\batch_executor.cpp(784)                 mongo::WriteBatchExecutor::insertMany+0x15b
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands\write_commands\batch_executor.cpp(846)                 mongo::WriteBatchExecutor::execInserts+0x247
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands\write_commands\batch_executor.cpp(686)                 mongo::WriteBatchExecutor::bulkExecute+0x6f
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands\write_commands\batch_executor.cpp(332)                 mongo::WriteBatchExecutor::executeBatch+0x2d4
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands\write_commands\write_commands.cpp(146)                 mongo::WriteCmd::run+0x157
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\dbcommands.cpp(1468)                                            mongo::Command::run+0x791
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\dbcommands.cpp(1340)                                            mongo::Command::execCommand+0x75f
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\commands.cpp(505)                                               mongo::runCommands+0x282
   2017-10-11T12:40:23.694+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\instance.cpp(263)                                               mongo::receivedCommand+0x287
   2017-10-11T12:40:23.695+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\instance.cpp(520)                                               mongo::assembleResponse+0x51d
   2017-10-11T12:40:23.695+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\db\db.cpp(180)                                                     mongo::`anonymous namespace'::MyMessageHandler::process+0x93
   2017-10-11T12:40:23.695+0300 I CONTROL  [conn11] mongod.exe    ...\src\mongo\util\net\message_server_port.cpp(229)                              mongo::PortMessageServer::handleIncomingMsg+0x3f8
   2017-10-11T12:40:23.698+0300 I CONTROL  [conn11] mongod.exe    c:\program files (x86)\microsoft visual studio 12.0\vc\include\thr\xthread(187)  std::_LaunchPad<std::_Bind<1,void *,void * (__cdecl*const)(void *),nspr::Thr
   ead *> >::_Go+0x10
   2017-10-11T12:40:23.699+0300 I CONTROL  [conn11] mongod.exe    f:\dd\vctools\crt\crtw32\stdcpp\thr\threadcall.cpp(28)                           _Call_func+0x17
   2017-10-11T12:40:23.699+0300 I CONTROL  [conn11] mongod.exe    f:\dd\vctools\crt\crtw32\startup\threadex.c(376)                                 _callthreadstartex+0x1b
   2017-10-11T12:40:23.699+0300 I CONTROL  [conn11] mongod.exe    f:\dd\vctools\crt\crtw32\startup\threadex.c(354)                                 _threadstartex+0x7c
   2017-10-11T12:40:23.703+0300 I CONTROL  [conn11] kernel32.dll                                                                                   BaseThreadInitThunk+0x12
   2017-10-11T12:40:23.703+0300 I CONTROL  [conn11] ntdll.dll                                                                                      RtlInitializeExceptionChain+0xef
   2017-10-11T12:40:23.704+0300 I CONTROL  [conn11]
   2017-10-11T12:40:23.705+0300 I CONTROL  [conn13] MapViewOfFileEx for C:\data\db\citibike.2 at address 00000000 failed with errno:8 Not enough storage is available to process this command. (file size is 268435456) in Memo
   ryMappedFile::map
   2017-10-11T12:40:23.708+0300 I -        [conn13] Assertion failure _state.get() < 0 C:\data\mci\89fbcdee7b6a486969190f06feaabe28\src\src\mongo/util/concurrency/rwlock.h 204

我還附上了mongorestore轉儲錯誤和mongod螢幕截圖

mongorestore 轉儲錯誤 在此處輸入圖像描述

蒙戈錯誤 在此處輸入圖像描述

任何幫助或建議將不勝感激。

使用 32 位 O/S,MongoDB 的 MMAP 儲存引擎的總可定址文件大小限制為 ~2GB 數據,包括索引(和日誌,如果啟用)。鑑於記憶體映射文件的 32 位限制,日誌在 32 位 MongoDB 建構上預設關閉,否則數據限制將減半。這不是任何重要數據的推薦配置:不干淨的關閉很可能導致數據完整性問題。

WiredTiger 儲存引擎是 MongoDB 3.2 及更新版本中的預設儲存引擎,僅支持 64 位作業系統。

從提供的日誌看來,您已經超過了 32 位伺服器可以映射記憶體的最大儲存大小:

2017-10-11T12:40:23.705+0300 我控制

$$ conn13 $$位於地址 00000000 的 C:\data\db\citibike.2 的 MapViewOfFileEx 失敗,出現 errno:8 沒有足夠的儲存空間來處理此命令。(文件大小為 268435456)在 MemoryMappedFile::map

如果您的數據庫對於 32 位作業系統上的 MMAP 限制來說太大了,您將不得不進行部分還原或升級到 64 位環境。

注意:32 位伺服器版本從 MongoDB 3.2 開始正式棄用,並且不再適用於 MongoDB 3.4+。

引用自:https://dba.stackexchange.com/questions/188187