Operational Defect Database

BugZero found this defect 60 days ago.

MongoDB | 2614342

Timeseries bucket collection creation should be idempotent

Last update date:

3/20/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

Direct creation of bucket collection with timeseries options is supported and currently used by mongosync and $out. The problem is that today this operation is not idempotent, consider the following scenario as an example: // Create a bucket collection with timeseries options assert.commandWorked(db.createCollection('system.buckets.coll', {timeseries: tsOptions})); // If we run the same operation again it will fail assert.commandWorked(db.createCollection('system.buckets.coll', {timeseries: tsOptions})); We also have an additional problem, if we first create the bucket collection with timeseries options, then the creation of a timeseries collection on the main namespace does not work. E.g.: // Create a bucket collection with timeseries options assert.commandWorked(db.createCollection('system.buckets.coll', {timeseries: tsOptions})); // If we attempt to create the timeseries collection afteward it will fail assert.commandWorked(db.createCollection('coll', {timeseries: tsOptions}));

Top User Comments


Steps to Reproduce

// Create a bucket collection with timeseries options assert.commandWorked(db.createCollection('system.buckets.coll', {timeseries: tsOptions})); // If we run the same operation again it will fail assert.commandWorked(db.createCollection('system.buckets.coll', {timeseries: tsOptions}));

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Open

Learn More

Search:

...