[SERVER-28271] invalid_system_views.js test cases may pass for the wrong reason Created: 10/Mar/17 Updated: 07/Sep/17 Resolved: 12/Apr/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.4, 3.5.6 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | James Wahlin |
| Resolution: | Done | Votes: | 0 |
| Labels: | bkp, neweng, read-only-views | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v3.4
|
||||||||||||
| Sprint: | Query 2017-04-17 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The test cases exercised by invalid_system_views.js may be passing for the wrong reason. They are missing the following elements, each of which will make the view definition invalid, regardless of conditions we want to test.
|
| Comments |
| Comment by Githook User [ 28/Apr/17 ] | |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: (cherry picked from commit b5e2615f9cf29942783ed554afeb364052dd83a4) | |
| Comment by Githook User [ 12/Apr/17 ] | |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: | |
| Comment by James Wahlin [ 11/Apr/17 ] | |
|
david.storch - there are currently nothing in place that prevents users from inserting an invalid view definition directly into the db.system.views collection. We couldn't ban direct insertion, as it would impact replication of view definitions. Given this a decision was made to allow startup with invalid views, making it possible to remove / correct the invalid view entries. When an invalid entry is found we skip loading the view catalog for the given database and print a warning in the mongod log. | |
| Comment by David Storch [ 11/Apr/17 ] | |
|
james.wahlin, why is it correct to skip over invalid view definitions rather than fail to start up? In general I would think that mongod would fail to start when we find something invalid or unexpected in the catalog metadata. | |
| Comment by James Wahlin [ 10/Apr/17 ] | |
|
In fixing one of the test cases I found a scenario where an invalid view entry can cause mongod to abort on startup:
I will add handling for this and any other scenarios found. Proper behavior when encountering an invalid view definition is to skip loading the view catalog for the given database, but allow mongod to start. | |
| Comment by James Wahlin [ 10/Mar/17 ] | |
|
In addition to fixing the existing tests, we should add new tests for:
|