mongos删除库表的一个bug
2017-03-06 15:50
295 查看
ISSUE SUMMARY
When dropping a database / collection in a sharded cluster, even if the drop is reported as successful it is possible the database / collection may still be present in some nodes in the cluster. At this time, we do not recommend that users drop a database or
collection and then attempt to reuse the namespace.
USER IMPACT
When the database/collection is not successfully dropped in a given node, the corresponding files continue to use disk space in that node. Attempting to reuse the namespace may lead to undefined behavior.
WORKAROUNDS
To work around this issue one can follow the steps below to drop a database/collection in a sharded environment:
Drop the database / collection using a mongos
Connect to each shard's primary and verify the namespace has been dropped. If it has not, please drop it. Dropping a database (e.g db.dropDatabase()) removes the data files on disk for the database being dropped.
Connect to a mongos, switch to the config database and remove any reference to the removed namespace from the collections chunks, locks, databases and collections:
Connect to each mongos and run flushRouterConfig
PS:也遭遇了,真坑,原文链接https://jira.mongodb.org/browse/SERVER-17397
When dropping a database / collection in a sharded cluster, even if the drop is reported as successful it is possible the database / collection may still be present in some nodes in the cluster. At this time, we do not recommend that users drop a database or
collection and then attempt to reuse the namespace.
USER IMPACT
When the database/collection is not successfully dropped in a given node, the corresponding files continue to use disk space in that node. Attempting to reuse the namespace may lead to undefined behavior.
WORKAROUNDS
To work around this issue one can follow the steps below to drop a database/collection in a sharded environment:
Drop the database / collection using a mongos
Connect to each shard's primary and verify the namespace has been dropped. If it has not, please drop it. Dropping a database (e.g db.dropDatabase()) removes the data files on disk for the database being dropped.
Connect to a mongos, switch to the config database and remove any reference to the removed namespace from the collections chunks, locks, databases and collections:
When dropping a database: |
use config |
db.collections.remove( { _id: /^DATABASE\./ } ) |
db.databases.remove( { _id: "DATABASE" } ) |
db.chunks.remove( { ns: /^DATABASE\./ } ) |
db.locks.remove( { _id: /^DATABASE\./ } ) |
When dropping a collection: |
use config |
db.collections.remove( { _id: "DATABASE.COLLECTION" } ) |
db.chunks.remove( { ns: "DATABASE.COLLECTION" } ) |
db.locks.remove( { _id: "DATABASE.COLLECTION" } ) |
PS:也遭遇了,真坑,原文链接https://jira.mongodb.org/browse/SERVER-17397
相关文章推荐
- python orm框架sqlalchemy执行更新、删除时遇到的一个bug
- 同一个事务里 查询 已删除但是未提交的数据[bug记录]
- python orm框架sqlalchemy执行更新、删除时遇到的一个bug
- 记一个SwipeMenuListView侧滑删除错乱的Bug
- 同一个事务里 查询 已删除可是未提交的数据[bug记录]
- 解决Windows7的一个bug,无法删除的文件
- 记一个SwipeMenuListView侧滑删除错乱的Bug
- 记一个SwipeMenuListView侧滑删除错乱的Bug
- IE9的一个BUG:propertychange和input事件在拖拽 / 剪切 / 删除时无法触发
- 一个常见的删除数组元素的bug
- Android开发中记一个SwipeMenuListView侧滑删除错乱的Bug
- MFC MainFrame中的 OnShowWindow一个bug
- 一个有关fstream类的bug
- 解决打印代码的一个Bug
- 我写的回溯法,出现了一个BUG,找了好久。。。。才对上。。。
- 使用bind与引用遇到的一个很诡异的bug
- EnterLib PIAB又一个BUG?[续]——这是一个致命的BUG
- 由一个“bug”到鲜为人知的jQuery.cssHooks
- 一个字符串引起的大bug
- 一个由sendfile引发的linux内核BUG