Repeatedly creating and dropping the same TTL index causes the TTL job to run multiple times within a single cycle

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.3.4
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Hide

      db.createCollection("coll");
      db.coll.createIndex({a:1}, { expireAfterSeconds: 1 });
      db.coll.dropIndex({a:1});
      db.coll.createIndex({a:1}, { expireAfterSeconds: 1 });
      db.coll.dropIndex({a:1});
      db.coll.createIndex({a:1}, {expireAfterSeconds: 1 });
      db.coll.dropIndex({a:1});
      db.coll.createIndex({a:1}, { expireAfterSeconds: 1 });

      Creating and dropping the index very quickly, and then change the log level.

      db.setLogLevel(1);

      more mongo.log | grep -i a_1 | grep 22533

      Show
      db.createCollection("coll"); db.coll.createIndex({a:1}, { expireAfterSeconds: 1 }); db.coll.dropIndex({a:1}); db.coll.createIndex({a:1}, { expireAfterSeconds: 1 }); db.coll.dropIndex({a:1}); db.coll.createIndex({a:1}, {expireAfterSeconds: 1 }); db.coll.dropIndex({a:1}); db.coll.createIndex({a:1}, { expireAfterSeconds: 1 }); Creating and dropping the index very quickly, and then change the log level. db.setLogLevel(1); more mongo.log | grep -i a_1 | grep 22533
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the latest version 8.3.4:

       

      db.createCollection("coll");
      db.coll.createIndex({a:1}, { expireAfterSeconds: 1 });
      db.coll.dropIndex({a:1});
      db.coll.createIndex({a:1}, { expireAfterSeconds: 1 });
      db.coll.dropIndex({a:1});
      db.coll.createIndex({a:1}, { expireAfterSexpireAfterSeconds: 1 });
      db.coll.dropIndex({a:1});
      db.coll.createIndex({a:1}, { expireAfterSeconds: 1 });

      db.setLogLevel(1);

      Repeatedly creating and dropping the TTL index causes the TTL index to run for multiple rounds within the same cycle.

      The expected behavior is that it runs only once per cycle.

       

       

      more mongo.log | grep -i a_1 | grep 22533

       

            Assignee:
            Unassigned
            Reporter:
            Chao Yin (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: