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

Make cloneCollectionAsCapped and convertToCapped work properly in case of concurrent DDLs

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Catalog and Routing
    • ALL

    Description

      The cloneCollectionAsCapped and convertToCapped commands are currently only exposed by replica sets (or shards) and SERVER-84091/SERVER-84482 are going to make them available on the router starting from v7.3. The implementation under those tickets will simply forward the request from the router to the primary shard for the targeted db.

      This is unsafe because both commands do not properly serialize with concurrent DDLs on the same namespace(s) and will be even more unsafe "tomorrow" (once unsharded collections will be tracked) because they are only creating the collection on the local catalog.

      Purpose of this ticket is to fix such limitation starting from v8.0. The new implementation could perform an aggregation to copy the documents and create the new capped collection. More details in this comment.

      Attachments

        Activity

          People

            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: