我正在尝试将一个新的3.4 (RocksDB引擎)成员添加到一个~2 TB副本集中,该副本集目前由3.2 (WiredTiger引擎)成员组成,并且在初始同步中遇到问题。由于不同的存储引擎,使用文件系统快照引导新成员的常见建议将无法工作。
复制启动良好,但最终会遇到InvalidSyncSource错误。奇怪的是,日志条目似乎声称主服务器的OpTime比次要服务器落后30秒以上,这在我看来是不可能的。我已经确认,主服务器在整个操作过程中始终处于状态主服务器状态,并且所有主机上的时钟都是同步的。
第一个迹象表明某些地方不正确(初始同步源是db-priy.xxxxxxxxxxxxxxxx:27017):
2017-04-28T10:58:52.183+0200 I REPL [replication-5] re-evaluating sync source because our current sync source's most recent OpTime is { ts: Timestamp 1493369879000|2, t: -1 } which is more than 30s behind member db-secondary.xxxxxxxxxxxxxxx:27017 whose most recent OpTime is { ts: Timestamp 1493369931000|2, t: -1 }
2017-04-28T10:58:52.183+0200 I REPL [replication-5] Finished fetching oplog during initial sync: InvalidSyncSource: sync source db-primary.xxxxxxxxxxxxxxx:27017 (last optime: { ts: Timestamp 0|0, t: -1 }; sync source index: -1; primary index: -1) is no longer valid. Last fetched optime and hash: { ts: Timestamp 1493369932000|1, t: -1 }[3606797002863800866]
2017-04-28T10:58:52.183+0200 E REPL [replication-5] Error fetching oplog during initial sync: InvalidSyncSource: sync source db-primary.xxxxxxxxxxxxxxx:27017 (last optime: { ts: Timestamp 0|0, t: -1 }; sync source index: -1; primary index: -1) is no longer valid我不确定这里第2行和第3行中的“时间戳0\0”是否有意义,但在我看来,它们也很奇怪。Mongo很高兴地继续同步,直到它复制了所有的数据库,然后发生了这样的事情:
2017-04-29T01:16:52.317+0200 E REPL [initial sync-0] Initial sync attempt failed -- attempts left: 9 cause: InvalidSyncSource: sync source db-primary.xxxxxxxxxxxxxxx:27017 (last optime: { ts: Timestamp 0|0, t: -1 }; sync source index: -1; primary index: -1) is no longer valid
2017-04-29T01:16:53.379+0200 I REPL [initial sync-0] sync source candidate: db-primary.xxxxxxxxxxxxxxx:27017是什么原因导致初始同步以这种方式失败?我唯一能想到的是,尝试从主悬挂中读取OpTime很长一段时间,返回的时间足够晚,可以与最近从二级读到的数据进行比较,但我认为/希望蒙戈能解释这一点。此外,在所有涉及的主机之间都有一个可靠的1 Gbit网络链接,没有迹象表明在网络级别上发生了任何错误。
不管可能的解释是什么,有没有人能建议一种可能防止这一问题发生的方法?
请注意,我成功地在一个小得多(大约300 GB)的复制集上执行了此操作,但如果问题随机发生,这可能是幸运的。
发布于 2017-05-03 08:06:50
这看起来像已知臭虫,它将在3.4.5版本中得到修正,希望在本月底之前发布。
https://dba.stackexchange.com/questions/172403
复制相似问题