Skip to content

Conversation

@djatnieks
Copy link

What is the issue

Follow up fix for CNDB-15995 so that a CC4 schema using memtable param {'class' : 'default'} will be de-serialized in the same way, instead of whichever memtable configuration class actually represents "default".

E.g. CNDB, uses StorageCompatibilityMode.CC_4. When it uses a CC4 style memtable param such as {'class' : 'default'} , CC 5.0 knows how to handle this map representation and default will use the memtable configuration that is defined as default, which happens to be TrieMemtable or trie. Later, when this schema is deserialized, the original implementation of CNDB-15995 in MemtableParams.toMapForCC4 handled this by producing {'class' : 'trie'}, but the CNDB tests are expecting that this should be consistent with the original {'class' : 'default'} that was used when the table was created.

What does this PR fix and why was it fixed

The fix here is to special case the handling of the default memtable configuration in MemtableParams.toMapForCC4 to recognize the default configuration and deserialize it as {'class' : 'default'} .

@github-actions
Copy link

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits
  • All new files should contain the DataStax copyright header instead of the Apache License one

…mtable configuration in CC4 compatibility mode.
@djatnieks djatnieks requested a review from driftx November 21, 2025 16:15
@djatnieks
Copy link
Author

@driftx I will have to wait for the artifactory license issue to be resolved before I can get build and test results, but I added you as reviewer in the meantime anyway.

@sonarqubecloud
Copy link

@djatnieks djatnieks merged commit ef37cba into main-5.0 Nov 21, 2025
582 of 592 checks passed
@djatnieks djatnieks deleted the CNDB-15995-follow-up branch November 21, 2025 20:32
djatnieks added a commit that referenced this pull request Nov 24, 2025
…hould be an empty map (#2139)

### 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 
> CNDB-15995 Preserve "default" configuration class name when
serializing memtable params for CC4 compatibility. (#2138) ef37cba
Daniel Jatnieks <jatnieks@pobox.com> Nov 21, 2025 at 12:32 PM

fixed CNDB tests `SchemaJsonSerDeTest` and `SchemaTrackerTest.smokeTest`
that 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 any `memtable =`
option, the default configuration is used, which in CC5 is `trie`. When
CNDB runs with `cndb.storage_compatibility_mode = CC_4` then this was
serialized back as `memtable = {'class' : 'trie'}`, but then it doesn't
match the original schema. Commit `ef37cba4b8` addressed by recognizing
that `trie` is the default configuration and instead serializing as
`memtable = {'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#testMixedVersionWritersWithCurrentVersionServices`
execute, they will send the CC4 version schema to an actual CC4 C*
instance. The problem is that CC4 does not recognize `memtable =
{'class' : 'default'}` and throws an exception.

This new change changes the serialization of `CC_4` compatibility mode
to still recognize that a `trie` configuration is the default, but now
serializes back as `memtable = {}`. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants