断电后全库数据丢失

发布问题 回首页

断电后全库数据丢失

★ 0 成为第一个关注这个问题的人

项目有个mongodb由于断电后无法启动,通过以下两种方式都无法读取到数据:
repair 模式恢复,如果元数据本身有问题,repair 模式也是无法工作的;
通过 WiredTiger 自带工具分析,对元数据损坏的情况也使用,能尽可能多的恢复数据(猜测是WiredTiger.wt文件损坏)
通过删除juournal后mongodb可启动,但是却丢失了所有数据,是否有办法直接从wt文件中把数据读取出来?
日志如下:
2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] MongoDB starting : pid=2768 port=27017 dbpath=D:\mongodb\db 64-bit host=WIN-7I7QFBOED7F

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] targetMinOS: Windows Vista/Windows Server 2008

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] db version v3.4.4

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] git version: 888390515874a9debd1b6c5d36559ca86b44babd

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] allocator: tcmalloc

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] modules: none

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] build environment:

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] distarch: x86_64

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] target_arch: x86_64

2018-05-24T12:02:52.662+0800 I CONTROL [initandlisten] options: { repair: true, storage: { dbPath: “D:\mongodb\db” } }

2018-05-24T12:02:52.663+0800 I – [initandlisten] Detected data files in D:\mongodb\db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.

2018-05-24T12:02:52.663+0800 I STORAGE [initandlisten] Detected WT journal files. Running recovery from last checkpoint.

2018-05-24T12:02:52.663+0800 I STORAGE [initandlisten] journal to nojournal transition config: create,cache_size=64822M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),

2018-05-24T12:02:56.060+0800 E STORAGE [initandlisten] WiredTiger error (0) [1527134576:59397][2768:8781149835856], file:collection-2-6275901123418866083.wt, WT_CURSOR.insert: read checksum error for 4096B block at offset 34094784512: block header checksum of 630942458 doesn’t match expected checksum of 2298237107

2018-05-24T12:02:56.060+0800 E STORAGE [initandlisten] WiredTiger error (0) [1527134576:59397][2768:8781149835856], file:collection-2-6275901123418866083.wt, WT_CURSOR.insert: collection-2-6275901123418866083.wt: encountered an illegal file format or internal value

2018-05-24T12:02:56.060+0800 E STORAGE [initandlisten] WiredTiger error (-31804) [1527134576:59397][2768:8781149835856], file:collection-2-6275901123418866083.wt, WT_CURSOR.insert: the process must exit and restart: WT_PANIC: WiredTiger library panic

2018-05-24T12:02:56.060+0800 I – [initandlisten] Fatal Assertion 28558 at src\mongo\db\storage\wiredtiger\wiredtiger_util.cpp 361

2018-05-24T12:02:56.060+0800 I – [initandlisten]

***aborting after fassert() failure

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\util\stacktrace_windows.cpp(239) mongo::printStackTrace+0×43

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\util\signal_handlers_synchronous.cpp(180) mongo::`anonymous namespace’::printSignalAndBacktrace+0×73

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\util\signal_handlers_synchronous.cpp(236) mongo::`anonymous namespace’::abruptQuit+0×83

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe d:\th\minkernel\crts\ucrt\src\appcrt\misc\signal.cpp(516) raise+0x25e

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe d:\th\minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(71) abort+0×18

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\util\assert_util.cpp(172) mongo::fassertFailedWithLocation+0×189

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\storage\wiredtiger\wiredtiger_util.cpp(361) mongo::`anonymous namespace’::mdb_handle_error+0x1fc

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\support\err.c(275) __wt_eventv+0×376

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\support\err.c(317) __wt_err+0×32

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\support\err.c(530) __wt_illegal_value+0x5e

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\block\block_read.c(225) __wt_block_read_off+0x1c2

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\block\block_read.c(101) __wt_bm_read+0x10b

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_io.c(45) __wt_bt_read+0xbc

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_read.c(415) __page_read+0x13e

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_read.c(525) __wt_page_in_func+0x16d

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\include\btree.i(1464) __wt_page_swap_func+0x3e

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\row_srch.c(446) __wt_row_search+0x49e

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_cursor.c(706) __wt_btcur_insert+0×491

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\cursor\cur_file.c(244) __curfile_insert+0×161

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\txn\txn_recover.c(178) __txn_op_apply+0x40c

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\txn\txn_recover.c(295) __txn_log_recover+0xb8

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\log\log.c(1862) __wt_log_scan+0x74e

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\txn\txn_recover.c(543) __wt_txn_recover+0x2d4

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\conn\conn_open.c(240) __wt_connection_workers+0×30

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\conn\conn_api.c(2457) wiredtiger_open+0xb1b

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\storage\wiredtiger\wiredtiger_kv_engine.cpp(247) mongo::WiredTigerKVEngine::WiredTigerKVEngine+0x7e1

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\storage\wiredtiger\wiredtiger_init.cpp(91) mongo::`anonymous namespace’::WiredTigerFactory::create+0x12f

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\service_context_d.cpp(202) mongo::ServiceContextMongoD::initializeGlobalStorageEngine+0x59c

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(590) mongo::`anonymous namespace’::_initAndListen+0×749

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(830) mongo::`anonymous namespace’::initAndListen+0×27

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(1180) mongoDbMain+0×226

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(868) wmain+0×35

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] mongod.exe f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(253) __scrt_common_main_seh+0x11d

2018-05-24T12:02:56.161+0800 I CONTROL [initandlisten] KERNEL32.DLL BaseThreadInitThunk+0x1a

2018-05-24T12:02:56.161+0800 F – [initandlisten] Got signal: 22 (SIGABRT).

2018-05-24T12:02:56.162+0800 I CONTROL [initandlisten] *** unhandled exception 0x0000000E at 0x000007FC837489CC, terminating

2018-05-24T12:02:56.162+0800 I CONTROL [initandlisten] *** stack trace for unhandled exception:

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] KERNELBASE.dll RaiseException+0×68

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\util\signal_handlers_synchronous.cpp(237) mongo::`anonymous namespace’::abruptQuit+0x9b

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe d:\th\minkernel\crts\ucrt\src\appcrt\misc\signal.cpp(516) raise+0x25e

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe d:\th\minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(71) abort+0×18

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\util\assert_util.cpp(172) mongo::fassertFailedWithLocation+0×189

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\storage\wiredtiger\wiredtiger_util.cpp(361) mongo::`anonymous namespace’::mdb_handle_error+0x1fc

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\support\err.c(275) __wt_eventv+0×376

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\support\err.c(317) __wt_err+0×32

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\support\err.c(530) __wt_illegal_value+0x5e

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\block\block_read.c(225) __wt_block_read_off+0x1c2

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\block\block_read.c(101) __wt_bm_read+0x10b

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_io.c(45) __wt_bt_read+0xbc

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_read.c(415) __page_read+0x13e

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_read.c(525) __wt_page_in_func+0x16d

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\include\btree.i(1464) __wt_page_swap_func+0x3e

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\row_srch.c(446) __wt_row_search+0x49e

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\btree\bt_cursor.c(706) __wt_btcur_insert+0×491

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\cursor\cur_file.c(244) __curfile_insert+0×161

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\txn\txn_recover.c(178) __txn_op_apply+0x40c

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\txn\txn_recover.c(295) __txn_log_recover+0xb8

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\log\log.c(1862) __wt_log_scan+0x74e

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\txn\txn_recover.c(543) __wt_txn_recover+0x2d4

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\conn\conn_open.c(240) __wt_connection_workers+0×30

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\third_party\wiredtiger\src\conn\conn_api.c(2457) wiredtiger_open+0xb1b

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\storage\wiredtiger\wiredtiger_kv_engine.cpp(247) mongo::WiredTigerKVEngine::WiredTigerKVEngine+0x7e1

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\storage\wiredtiger\wiredtiger_init.cpp(91) mongo::`anonymous namespace’::WiredTigerFactory::create+0x12f

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\service_context_d.cpp(202) mongo::ServiceContextMongoD::initializeGlobalStorageEngine+0x59c

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(590) mongo::`anonymous namespace’::_initAndListen+0×749

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(830) mongo::`anonymous namespace’::initAndListen+0×27

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(1180) mongoDbMain+0×226

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe …\src\mongo\db\db.cpp(868) wmain+0×35

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] mongod.exe f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(253) __scrt_common_main_seh+0x11d

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] KERNEL32.DLL BaseThreadInitThunk+0x1a

2018-05-24T12:02:56.170+0800 I – [initandlisten]

2018-05-24T12:02:56.170+0800 I CONTROL [initandlisten] writing minidump diagnostic file C:\Program Files\MongoDB\Server\3.2018-05-24T04-02-56.mdmp

2018-05-24T12:02:56.197+0800 I CONTROL [initandlisten] *** immediate exit due to unhandled exception

wuhaipinm 在大约 之前添加了 Open 状态
  • 提问于
  • Answers0 个
  • 浏览 8 次
  • 最新活跃于

问题状态

  • Open

类别

1 个 参与者

断电后全库数据丢失》有12个想法

  1. 谢答,但个人认为不准确,1.mr我觉得不适合实时计算,更贴合后期数据统计需求,2.aggregate必须支持自定义函数,就好像你定义个abc(1,2)一样肯定是计算了,现在的问题是abc(1,2)这个参数我想传个字段进去,比如abc($qty,2)这样….他就不好使了….难道大家没有在aggregate中用字段进行计算的经历么?

发表评论