Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14222

Replica set members should disallow dropping local.oplog.rs

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.6.1
    • Component/s: Replication
    • None
    • Environment:
      Only tested on OS X, might be different elsewhere.

      By inspection, it is possible to drop local.oplog.rs while a mongod is running as a replica set member (primary or secondary):

      rs0:PRIMARY> db.oplog.rs.drop()
      true
      rs0:PRIMARY> show collections
      me
      slaves
      startup_log
      system.indexes
      system.replset
      

      When this operation is performed on a node running as primary, the next write operation appears to cause the server to crash:

      rs0:PRIMARY> use test
      switched to db test
      rs0:PRIMARY> db.people.insert({"name":"Jones"});
      2014-06-10T16:45:40.891-0400 DBClientCursor::init call() failed
      2014-06-10T16:45:40.892-0400 Error: error doing query: failed at src/mongo/shell/collection.js:258
      

      (Clearly this behavior is not intended to be safe, however, it seems as if it would be possible to prohibit such unsafe operations.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            richard.kreuter Richard Kreuter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: