CASSANDRA-21156 Avoid initializing system keyspaces during legacy threshold conversion - #5156
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-21156 Avoid initializing system keyspaces during legacy threshold conversion#5156cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
cheeeee
force-pushed
the
CASSANDRA-21156-trunk
branch
from
September 11, 2026 22:51
3fb8629 to
cdf3435
Compare
Resolve system table names from configuration-independent constants. Keep Accord journal metadata sensitive to the loaded configuration in both tool and daemon initialization, without a daemon-only index guard. Exercise fresh-JVM initialization orderings and converter boundaries. CASSANDRA-21156 Generated-by: Claude (Anthropic)
cheeeee
force-pushed
the
CASSANDRA-21156-trunk
branch
from
September 12, 2026 03:56
cdf3435 to
70f5d0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CASSANDRA-21156: setting the legacy table_count_warn_threshold (or keyspace_count_warn_threshold) makes
startup fail with ExceptionInInitializerError. The YAML converter for these keys calls
SchemaConstants.getLocalAndReplicatedSystemTableNames(), which initializes SystemKeyspace and the other
system keyspace classes; their static initializers read DatabaseDescriptor, which is still being loaded,
and throw NullPointerException.
Changes:
constants of SystemKeyspace, TraceKeyspace, AuthKeyspace, SystemDistributedKeyspace and AccordKeyspace.
Referencing a compile-time constant does not trigger class initialization (JLS 12.4.1), so the
converter no longer initializes any keyspace class. The TABLE_NAMES fields of those classes now alias
the SchemaConstants sets, so there is a single definition.
(guardrail disabled). A legacy value that is not larger than the number of system tables/keyspaces now
converts to 0 with a warning, i.e. warn on any user creation; it used to convert to a zero or negative
number. This is a semantics change for such (unusually small) legacy values.
Testing:
thresholds and asserts DatabaseDescriptor.getRawConfig() is still null afterwards, plus the boundary
values of the clamp. Without the change it fails with the ExceptionInInitializerError from the ticket
(SystemKeyspace. via SchemaConstants via Converters).
keyspace metadata, so the hoisted constants cannot drift from the real schema.
JVM): the journal_sai index on system_accord.journal is still configured after YAML initialization in
daemon and in tool mode.
CASSANDRA-21156