[SERVER-17335] Add validation for WiredTiger index and collection options Created: 20/Feb/15  Updated: 05/Feb/16  Resolved: 14/Jul/15

Status: Closed
Project: Core Server
Component/s: Storage, WiredTiger
Affects Version/s: None
Fix Version/s: 3.1.6

Type: Bug Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on WT-1739 Add an API to validate configuration ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Quint 3.1.0, Quint Iteration 3.1.1, Quint Iteration 4, Quint Iteration 5, Quint Iteration 6
Participants:

 Description   

WiredTigerRecordStore::parseOptionsField and WiredTigerIndex::parseIndexOptions currently only check that storageEngine.wiredTiger.configString is a string. They should be changed to call wiredtiger_config_validate() and verify that the configuration is valid to pass to WT_SESSION::create.



 Comments   
Comment by Keith Bostic (Inactive) [ 09/Sep/15 ]

ramon.fernandez, you are correct, the wiredtiger_config_validate functionality isn't present in the mongodb-3.0 branch of WT.

wiredtiger_config_validate will be messy to backport to mongodb-3.0; it's not a complex or tricky change, but it's relatively big and a lot of files changed, it's not very self-contained.

My understanding of this change was it wasn't a bug fix, it was an enhancement to do better error checking of configuration strings, is that causing problems for users?

michael.cahill, FYI.

Comment by Githook User [ 14/Jul/15 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-17335 Fix lint.
Branch: master
https://github.com/mongodb/mongo/commit/9412843d62dd9c8b2eb919c79dd8f2b29e058564

Comment by Githook User [ 14/Jul/15 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-17335 Add validation for WT index and collection options.
Branch: master
https://github.com/mongodb/mongo/commit/53e22c174d258800b9a12cf971d92ec6d6700ab9

Comment by Keith Bostic (Inactive) [ 27/Apr/15 ]

redbeard0531, I think this change is ready to be connected into MongoDB, can we talk through that work?

Comment by Keith Bostic (Inactive) [ 24/Apr/15 ]

The changes in WiredTiger are complete and merged into the develop branch (see GitHub issue 1739 for details).

For the record, there's a new function in WiredTiger, wiredtiger_config_validate, called as follows:

int
wiredtiger_config_validate(
    WT_SESSION *session,        /* session handle, may be NULL */
    WT_EVENT_HANDLER *handler,  /* error handler, may be NULL */
    const char *method,         /* method name */
    const char *config);        /* configuration string being validated */
 
The method name argument is a public function name, or a public handle 
plus a period, plus the method name. For example, "wiredtiger_open", or
"WT_SESSION.create", or "WT_CURSOR.close":
 
    ret = wiredtiger_config_validate(
         NULL, handler, "WT_SESSION.create", "block_allocation=first");
 
Error handling is done via the WT_SESSION handle, if non-NULL, otherwise
through the the WT_EVENT_HANDLER, if non-NULL, otherwise errors to stderr.
 
The wiredtiger_config_validate call returns zero for success, non-zero 
to indicate an error.

Comment by Keith Bostic (Inactive) [ 07/Apr/15 ]

dan@10gen.com, my mistake, I missed a connection.

We're tracking this work in pull request 1739.

michael.cahill, I'd like to review this change with you when you're back.

Comment by Keith Bostic (Inactive) [ 06/Apr/15 ]

dan@10gen.com, can you point me to a writeup of what this API should do?

Generated at Thu Feb 08 03:44:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.