11601 Interrupted: Operation was interrupted(操作被中断)
MongoDB含义
正在运行的操作被中断。由于外部干预或服务器状态变化,MongoDB 在其完成前终止了该操作。
原因
管理员/工具用 db.killOp() 终止了操作;服务器正在关闭;副本集中主节点发生变更(stepdown/故障转移)。(超过 maxTimeMS 返回的是 50 MaxTimeMSExpired,而不是此错误。)长时间运行的查询可以通过这种方式停止。
解决方法
调查操作被中断的原因:currentOp/killOp 历史、故障转移事件、服务器维护。如果操作是幂等的,可安全重试。优化并缩短长查询;添加合适的索引。在驱动中使用暂时性错误重试逻辑;确保副本集故障转移时自动重连。
同一数据库的其他条目
- 263 OperationNotSupportedInTransactionOperation not supported inside a multi-document transaction(多文档事务中不支持该操作)
- 20 IllegalOperationIllegal operation(非法操作)
- 48 NamespaceExistsNamespace (collection) already exists(命名空间(集合)已存在)
- 85 IndexOptionsConflictIndex already exists with different options / different name(索引已存在但选项不同/名称不同)
- 67 CannotCreateIndexCannot create index(无法创建索引)
- 27 IndexNotFoundIndex not found(未找到索引)
- 79 UnknownReplWriteConcernUnknown replica set write concern(未知的副本集写关注)