0

新手使用mongo遇到错误,测试环境是ok的但本地搭建环境时出现如下错误,有没有大神遇到过这个问题,指条明路。

错误提示如下:

Unable to read from a snapshot due to pending collection catalog changes; please retry the operation. Snapshot timestamp is Timestamp(1642671752, 1). Collection minimum is Timestamp(1642671756, 5)

环境是docker构建的一主两从复制集

version: ‘3’
services:
  mongo1:
    container_name: “mongo1”
    image: mongo
    ports:
      – “30001:30001”
    command: mongod –replSet docker-rs –bind_ip_all –port 30001
    links:
      – mongo2:mongo2
      – mongo3:mongo3
    volumes:
      – ./mongo1/data:/data/db
    restart: always
  mongo2:
    container_name: “mongo2”
    image: mongo
    ports:
      – “30002:30002”
    command: mongod –replSet docker-rs –bind_ip_all –port 30002
    volumes:
      – ./mongo2/data:/data/db
    restart: always
  mongo3:
    container_name: “mongo3”
    image: mongo
    ports:
      – “30003:30003”
    command: mongod –replSet docker-rs –bind_ip_all –port 30003
    volumes:
      – ./mongo3/data:/data/db
    restart: always

代码逻辑:
在一个事务里
1. 创建一个新的企业database
2. 创建企业database下member集合
3. 插入member数据时发生错误

已回答的问题