changelog and actionlog become non-capped after drop

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.0.8, 3.2.0
    • Component/s: Sharding
    • 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
              [DO NOT USE] Backlog - Sharding Team
              Reporter:
              Kevin Pulo
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: