...
There are a few places in the code which assume that a collection name with 'system.buckets' prefix implies that, the collection is a time-series collection. But we do allow users to create a regular collection with 'system.buckets' prefix. This might lead to some inconsistent behaviour. We generally don't allow users to create a collection with 'system.' prefix, so we should not treat 'system.buckets' prefix differently.
gregory.noma commented on Mon, 24 Oct 2022 21:12:30 +0000: For the reasons mentioned above, I don't think we can do this ticket as described. I am closing it out and I have filed SERVER-70822 as a potential follow-up. If the state of things changes in the future and it does become possible, we can reconsider. gregory.noma commented on Wed, 19 Oct 2022 15:20:48 +0000: We can't totally ban creating a collections beginning with system.buckets because mongorestore needs to be able to create those collections. An alternative idea was to restrict this to only users with the restore role and remove it from all other built-in roles. However, the issue here is that users could always just create custom roles which give this ability, and we don't currently have a way to restrict custom roles in this way. JIRAUSER1257318 commented on Tue, 11 Oct 2022 13:20:36 +0000: I filed .system.buckets.' collection" class="issue-link" data-issue-key="SERVER-70445">SERVER-70445 to investigate that possibility. gregory.noma commented on Fri, 7 Oct 2022 15:42:21 +0000: We generally don't allow users to create a collection with 'system.' prefix This actually isn't really the case; we allow users to create a system collection as long as it is a valid system collection. For instance, users can create system.views or system.resharding.a but they cannot create system.foo. So following this pattern would imply that we should not make this change. henrik.edin commented on Tue, 23 Nov 2021 16:35:48 +0000: We need to check so this doesn't break mongorestore.
> db.createCollection("system.new") { "ok" : 0, "errmsg" : "Invalid system namespace: test.system.new", "code" : 73, "codeName" : "InvalidNamespace" } > db.createCollection("system.buckets.new") { "ok" : 1 } > db.new.insert({}) WriteCommandError( { "ok" : 0, "errmsg" : "time-series insert failed: test.new :: caused by :: Time-series buckets collection is missing time-series options", "code" : 72, "codeName" : "InvalidOptions" } )