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

Add optional 'max' option to db command 'convertToCapped'

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Admin
    • None
    • Storage Execution

    Description

      We rely on both the 'size' and 'max' options for a particular capped collection in our application. We also allow configuration changes to the 'max' option. When this happens, we drop and re-create the capped collection with the new 'max' option.

      The problem is that we have a lot of other programs that are always inserting lots of data to this collection... so in between the drop and create, if an insert occurs, our collection is no longer capped:

      my $cmd = Tie::IxHash->new(create => "Logs", capped => boolean::true, size => MAX_CAPPED_SIZE, max => $max_msgs);
      $db->run_command(Tie::IxHash->new(drop => 'Logs'));
      $db->run_command($cmd);

      The only solution I could find was the 'convertToCapped' database command, which would help us by locking the collection while converting. However, this command doesn't support the 'max' option.

      Another solution would be the ability to drop and create a collection atomically (i.e. one database command instead of two), since the 'create' command supports the max 'option'

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            schou@barracuda.com Samuel Chou
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: