Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15885

Investigate changes in SERVER-71678: Allow compact to run on system collections

    XMLWordPrintableJSON

Details

    • 2

    Description

      Original Downstream Change Summary

      It is now possible to run compact on a system collection.

      Interestingly, it appears that the docs for the compact command already incorrectly state this is possible, dating back as far as at least 4.2 ("For system collections...."): https://www.mongodb.com/docs/v4.2/reference/command/compact/#compact-required-privileges

      Description of Linked Ticket

      System collections can't be compacted:

      // Items in system.* cannot be moved as there might be pointers to them.
      uassert(ErrorCodes::InvalidNamespace, "can't compact a system namespace", !nss.isSystem());
      

      This restriction was added in SERVER-11595 and is likely an MMAP limitation. With WiredTiger being the default storage engine, this is no longer necessary as WiredTiger supports online compaction.

      Attachments

        Activity

          People

            corry.root@mongodb.com Corry Root
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 1 day ago