|
Author:
{u'username': u'mtrussotto', u'name': u'Matthew Russotto', u'email': u'matthew.russotto@10gen.com'}
Message: SERVER-29191 Dropping an index named "" is ambiguous because createIndexes permits an index to be named ""
Disallows creating or individually dropping an index named "*".
Branch: master
https://github.com/mongodb/mongo/commit/1447d3db59804752e6c2882a6a8a4a14d7ae71ad
|
|
Okay, so we will prevent new indexes from being named "*". The only way to drop a "*" index is by key pattern, since dropping by the name "*" will drop all indexes, so before we drop an index by key pattern here we will check if it's name is "*" and if so return an error saying they must drop the collection or downgrade to drop the index.
|
|
I think we should make 3.6 prevent new indexes from being named "*", but grandfather in preexisting ones. We should also prevent indexes named "*" from being individually dropped. The only ways to drop them will be to either drop the underlying collection or downgrade.
|
One option would be to just disallow creating collections named "*". If any users had already created an index named "*", dropping it would drop all of their indexes on secondaries, and no future version of mongodb would prevent that.
judah.schvimer, I doubt a user actually created an index named "*", so I don't think it would too significant of a breaking change to reject them in MongoDB 3.6. This would involve making MongoDB 3.6 fail to start if there's an existing index named "*" or a MongoDB 3.6 secondary receives an oplog entry to create an index named "*". milkie, do you have thoughts about what we should do here?
|
|
max.hirschhorn, Do you have a proposed fix? One option would be to just disallow creating collections named "*". If any users had already created an index named "*", dropping it would drop all of their indexes on secondaries, and no future version of mongodb would prevent that. Alternatively, we no longer make oplog entries that drop multiple indexes, so we could make it so secondaries do not drop all their indexes when they receive a "*" and rather just drop the "*" named index. This would special case oplog application which is not normal, and if a new server replayed an old oplog entry that meant for it to drop all of its indexes, it would only drop an index named "*".
|
|
judah.schvimer since this was related to your work we're passing this to the repl backlog but query is happy to do the CR.
|
Generated at Thu Feb 08 04:20:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.