Operational Defect Database

BugZero found this defect 39 days ago.

MongoDB | 2637907

Rename collection to a bucket does not consider already existing target collection

Last update date:

4/10/2024

Affected products:

MongoDB Server

Affected releases:

5.0.0

6.0.0

7.0.0

8.0.0-alpha1

Fixed releases:

No fixed releases provided.

Description:

Info

renaming a timeseries bucket collection is currently allowed (under special priviledges) and also used internally by $out. The problem is that when we execute a rename of a timeseries bucket collection we do not check if a collection already exist on the target main namespace. For instance, if we do the following: db.createCollection( 'srcColl', { timeseries: { timeField: "timestamp", metaField: "metadata" } }) db.createCollection( 'dstColl') db.system.buckets.srcColl.renameCollection(system.buckets.dstColl); The rename should fail because the target collection already exists and instead it works leaving the local catalog with both normal collection 'db.dstColl' and timeseries bucket collection 'db.system.buckets.dstColl' We should extend jstests/core/rename_system_buckets_collections.js to cover those scenarios.

Top User Comments


Steps to Reproduce

db.createCollection( 'srcColl', { timeseries: { timeField: "timestamp", metaField: "metadata" } }) db.createCollection( 'dstColl') db.system.buckets.srcColl.renameCollection(system.buckets.dstColl);

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...