[SERVER-1864] Support Resizing Capped Collections Created: 27/Sep/10  Updated: 23/Mar/23  Resolved: 04/Mar/22

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 1.7.0
Fix Version/s: 6.0.0-rc0

Type: New Feature Priority: Minor - P4
Reporter: Tejaswi Nadahalli Assignee: Fausto Leyva (Inactive)
Resolution: Done Votes: 64
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-15148 Investigate changes in SERVER-1864: S... Closed
Duplicate
is duplicated by SERVER-55237 Create a new command that resizes reg... Closed
is duplicated by SERVER-3230 Can capped collection auto increase s... Closed
Related
related to SERVER-67036 Creating capped collections does not ... Closed
related to SERVER-64186 Evaluate doing batched capped deletes... Open
is related to SERVER-69223 Resizing capped collection does not work Closed
is related to DOCS-15981 [Server] Specify that using collMod t... Closed
is related to DOCS-15579 [Server] Resize of capped collections... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-12-13, Execution Team 2021-12-27, Execution Team 2022-01-10, Execution Team 2022-01-24, Execution Team 2022-02-07, Execution Team 2022-02-21, Execution Team 2022-03-07
Participants:

 Description   

Allow users to resize capped collections using the 'collMod' command. Create two new parameters for 'collMod' to either increase or decrease the size and/or the document limit of a capped collection.  

Example resize command: 

{collMod: "cappedCollection", cappedSize: maxSize, cappedMax: maxDocs}

This operation may only be performed when the featureCompatibilityVersion is set to at least 6.0.



 Comments   
Comment by Githook User [ 03/Mar/22 ]

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-1864 Support Capped Collection Size Increase
Branch: master
https://github.com/mongodb/mongo/commit/d9f9585cdcd285e9c12ba2fd459f9be7e666082d

Comment by Eric Milkie [ 25/Jun/21 ]

If you change "disk size" to "uncompressed size", that use case is what the Description in this ticket is for (we would probably allow changes in the cap size in both directions, if we implmented this ticket).

Comment by Puya Daravi [ 24/Jun/21 ]

milkie Fair enough. What if we change "disk size" to "uncompressed size" in the above use case?

Comment by Eric Milkie [ 24/Jun/21 ]

The use case you describe isn't possible to implement, because deleting documents does not necessarily turn into a reduction in on-disk file size unless you wait for the deletes to fall out of the MVCC history window, and then run a compaction, and then you're still not guaranteed to get the disk space back.

Comment by Puya Daravi [ 24/Jun/21 ]

Hi, since capped collections seem to be planned to be deprecated. Is there currently a way to achieve this use case with existing MongoDB features? If not are there any features planned that would enable this use case?

  • User creates a collection, whose disk size (not uncompressed size) does not exceed a specified value
  • User is able to adjust the limit later on: reducing the limit would remove oldest documents as needed and increasing the size would just work, in both cases without downtime.
Comment by Justin Smestad [ 03/Mar/11 ]

We would love to see this feature make it into MongoDB 1.9 if possible. Capped collections are somewhat crippled until then since they are possibly the only limit in MongoDB with regards to effective changing of schema design/implementation.

Generated at Thu Feb 08 02:58:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.