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

changelog and actionlog become non-capped after drop

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.8, 3.2.0
    • Component/s: Sharding
    • Labels:
    • Sharding
    • ALL
    • Hide
      sh.startBalancer();
      assert(db.getSiblingDB("config").changelog.stats().capped);
      assert(db.getSiblingDB("config").actionlog.stats().capped);
      assert(db.getSiblingDB("config").changelog.drop());
      assert(db.getSiblingDB("config").actionlog.drop());
      assert.commandWorked(sh.enableSharding("test"));
      assert.commandWorked(sh.shardCollection("test.test", {_id:1}));  // cause config.changelog entry
      sleep(11*1000);  // wait for balancing round to put something in config.actionlog
      assert(db.getSiblingDB("config").changelog.stats().capped);  // FAILS
      assert(db.getSiblingDB("config").actionlog.stats().capped);  // FAILS
      
      Show
      sh.startBalancer(); assert (db.getSiblingDB( "config" ).changelog.stats().capped); assert (db.getSiblingDB( "config" ).actionlog.stats().capped); assert (db.getSiblingDB( "config" ).changelog.drop()); assert (db.getSiblingDB( "config" ).actionlog.drop()); assert .commandWorked(sh.enableSharding( "test" )); assert .commandWorked(sh.shardCollection( "test.test" , {_id:1})); // cause config.changelog entry sleep(11*1000); // wait for balancing round to put something in config.actionlog assert (db.getSiblingDB( "config" ).changelog.stats().capped); // FAILS assert (db.getSiblingDB( "config" ).actionlog.stats().capped); // FAILS

      config.changelog and config.actionlog are created as 10MB and 2MB capped collections. However, if they are dropped, then the next time a document is inserted they get auto-recreated as regular (non-capped) collections. From there they can expand to consume large amounts of disk space.

      One solution would be to automatically correct this situation by periodically (eg. each balancer round) checking to see if these collections aren't capped, and if so, running convertToCapped on them.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: