CNDB-15995 The default memtable configuration for CC4 compatibility should be an empty map, not a map containing "class : default" #2139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



What is the issue
Another follow up fix for CNDB-15995.
What does this PR fix and why was it fixed
The previous follow up to CNDB-15995
fixed CNDB tests
SchemaJsonSerDeTestandSchemaTrackerTest.smokeTestthat failed in the CNDB side PR related to this issue (CNDB-15995). The issue was around round-trip serialization/deserialization of schema's being the same. If the original schema does not include anymemtable =option, the default configuration is used, which in CC5 istrie. When CNDB runs withcndb.storage_compatibility_mode = CC_4then this was serialized back asmemtable = {'class' : 'trie'}, but then it doesn't match the original schema. Commitef37cba4b8addressed by recognizing thattrieis the default configuration and instead serializing asmemtable = {'class' : 'default'}which the CC5 memtable processing of CC4 style map options is able to process, and fixed that as far as that goes.However, this created a new problem because when CNDB migration tests, such as
CDCMigrationTest#testMixedVersionWritersWithCurrentVersionServicesexecute, they will send the CC4 version schema to an actual CC4 C* instance. The problem is that CC4 does not recognizememtable = {'class' : 'default'}and throws an exception.This new change changes the serialization of
CC_4compatibility mode to still recognize that atrieconfiguration is the default, but now serializes back asmemtable = {}. The intent is to preserve the default meaning. e.g.trie, or some other config, is being used because it was the "default". Serialization should reflect that the memtable configuration is the "default" too and whichever C* version consumes that schema can interpret what default means.