MongoDB 和 WiredTiger 兼容性问题

MongoDB and WiredTiger compatibility issue

今天,Google Kubernetes Engine 上我的 MongoDB 容器 运行 突然停止工作,这是生成的日志:

2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=mongo-db-0
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] db version v3.6.20
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] git version: 39c200878284912f19553901a6fea4b31531a899
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] modules: none
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] build environment:
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] distarch: x86_64
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] options: { net: { bindIpAll: true } }
2020-09-30T07:01:42.782+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten]
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=334M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2020-09-30T07:01:43.433+0000 E STORAGE [initandlisten] WiredTiger error (95) [1601449303:433554][1:0x7f9f6c49da40], wiredtiger_open: __wt_conn_compat_config, 226: Version incompatibility detected: required max of 3.0cannot be larger than saved release 3.3: Operation not supported Raw: [1601449303:433554][1:0x7f9f6c49da40], wiredtiger_open: __wt_conn_compat_config, 226: Version incompatibility detected: required max of 3.0cannot be larger than saved release 3.3: Operation not supported
2020-09-30T07:01:43.434+0000 E - [initandlisten] Assertion: 28595:95: Operation not supported src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 488
2020-09-30T07:01:43.434+0000 I STORAGE [initandlisten] exception in initAndListen: Location28595: 95: Operation not supported, terminating
2020-09-30T07:01:43.434+0000 F - [initandlisten] Invariant failure globalStorageEngine src/mongo/db/service_context_d.cpp 272
2020-09-30T07:01:43.435+0000 F - [initandlisten]

我测试了旧的 Mongo 容器版本,但它没有用。我以前遇到过这个问题,我能够通过完全擦除持久存储来修复它,但不幸的是这次我不能这样做。

如何在不擦除存储数据的情况下解决此兼容性问题?

存储的 WiredTiger 版本 3.3 意味着数据文件是由从 4.2.6 到 4.2.8 的 MongoDB 版本写入的。

其中一个版本应该能够打开这些文件。