ISSUE DESCRIPTION AND IMPACT
In MongoDB 4.4.3, WiredTiger fails to parse the de-supported huffman_key option during table creation. This prevents initial syncs and mongorestores of collections created prior to MongoDB 4.4.3, if any collections were created with a user-supplied wiredTiger configuration string.
In WT-6678, support for Huffman Encoding of keys was removed, but collections created prior to MongoDB 4.4.3 still contain the huffman_key option that was provided at collection creation time. Attempts to re-use this option (via initial sync and mongorestore with options) trigger the bug.
DIAGNOSIS AND AFFECTED VERSIONS
This bug exists in MongoDB 4.4.3 and affects collections created in any earlier version. Methods for doing this include:
- explicit createCollection commands that specify a storageEngine.wiredTiger.configString value that includes huffman_key.
- any collection creation performed while mongod was running with the --wiredTigerCollectionConfigString parameter enabled.
For these collections on 4.4.3, initial sync fails and logs a Collection clone failed message with an unknown configuration key: 'huffman_key': Invalid argument error.
Mongorestore also fails, with:
error running create command: (BadValue) 22: Invalid argument. wiredtiger_config_validate: config_check_search, 65: unknown configuration key: 'huffman_key': Invalid argument.
REMEDIATION AND WORKAROUNDS
Upgrade to 4.4.4 to resync or mongorestore. It is not currently possible to change a user-supplied WiredTiger collection configuration string in-place.
If necessary:
- to sync a node in 4.4.3, use the sync by copying data files method. Or, start the new node using version 4.4.2 and upgrade it when sync is complete.
- mongorestore can be used in 4.4.3 with the --noOptionsRestore flag.
Original Description
As part of WT-6678, the huffman_key encoding support is removed along with the configuration options to control it. The older versions of MongoDB < 4.4.3 where the option of huffman_key is configured to all the tables that are created in WiredTiger metadata. Whenever these databases are upgraded to the newer versions like 4.4.3 and above leads to a problem in parsing the old configuration option that is not known.