Skip to content

fix: replace SimpleStrategy with NetworkTopologyStrategy in patches#141

Merged
dkropachev merged 2 commits into
scylladb:masterfrom
nikagra:fix/simple-strategy-to-nts
May 5, 2026
Merged

fix: replace SimpleStrategy with NetworkTopologyStrategy in patches#141
dkropachev merged 2 commits into
scylladb:masterfrom
nikagra:fix/simple-strategy-to-nts

Conversation

@nikagra

@nikagra nikagra commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Problem

ScyllaDB PR scylladb/scylladb#25342 changed ks_prop_defs::as_ks_metadata() so that when tablets are globally enabled (the default on recent ScyllaDB), initial_tablets = 0 is set for all replication strategies. SimpleStrategy then validates tablet support and throws:

InvalidConfigurationInQueryException: SimpleStrategy doesn't support tablet replication

This caused Jenkins build #1989 to regress across all tested 3.x and 4.x driver versions:

Driver Errors
datastax 4.19.2 +89 errors
datastax 4.19.1 +97 errors
scylla 4.19.0.8 +84 errors
scylla 4.18.1.0 +105 errors
scylla 3.x affected (not in #1989 matrix, addressed in this PR)

The majority of failures cascaded from SessionUtils.createKeyspace() (called by SessionRule.before()), which hardcodes SimpleStrategy — causing entire test classes to be skipped when it throws.

Fix

Replace SimpleStrategy with NetworkTopologyStrategy in all integration test keyspace creation statements in each version's patch. The DC name follows CCM convention: dc1 for 4.x driver tests, datacenter1 for 3.x driver tests. NTS supports tablets and is the correct strategy for single-DC test clusters.

Changes per patch

Each updated patch is a single combined diff (existing Scylla compatibility changes + new NTS migration) applied from the clean tag.

4.x patches (datastax/4.19.1, datastax/4.19.2, scylla/4.18.1.0, scylla/4.19.0.8)

DC name: dc1 (CCM default for 4.x). Key changes:

  • SessionUtils.createKeyspace() — central fix, resolves majority of cascading failures
  • SchemaChangesIT — CQL statements updated + assertion updated (dc1 key instead of replication_factor, hasSize(2) removed since NTS maps contain more entries)
  • TokenITBase, SimpleStatementCcmIT — CQL statements
  • LWTLoadBalancingIT, MailboxServiceImpl — CQL statements (ScyllaDB driver versions only)
  • DefaultKeyspaceIT, QueryKeyspaceAndTableIT — mapper test CQL statements

scylla/3.11.5.14 (new patch)

The matrix framework falls back to the most recent existing patch version when a specific version has no patch. Since 3.11.5.14 is the current latest 3.x release, it is more appropriate to aggregate all fixes into it rather than updating older patch files.

This patch is created from scratch (the version had no prior patch) and includes everything needed to pass Jenkins tests on modern Scylla (2026.2.0~dev):

SimpleStrategy → NTS migration (DC name: datacenter1, CCM default for 3.x):

  • TestUtils.javaCREATE_KEYSPACE_SIMPLE_FORMAT constant (fixes all callers: CCMTestsSupport, AbstractPoliciesTest, etc.)
  • AsyncQueryTest, ControlConnectionTest, MetadataTest, PreparedStatementInvalidationTest, ShardAwarenessTest, StatementPagesTest, TokenIntegrationTest, TupleTest, UnresolvedUserTypeTest, UserTypesTest — inline CQL statements

CCMBridge compatibility fixes (modern Scylla CCM):

  • Remove release: prefix logic — VersionNumber.parse("2026.2.0~dev") succeeds, causing release:2026.2.0~dev to be passed to CCM which fails. Now passes the version string bare.
  • Remove -t (thrift) flag from ccm add — CCM dropped thrift support.
  • Use deterministic jmxPort = 7000 + n * 100 in add() instead of findAvailablePort() to avoid TOCTOU races and match the fallback in jmxAddressOfNode().

SessionStressTest — add jvmArgs = {"--smp", "1", "--max-networking-io-control-blocks", "15000"} to @CCMConfig to prevent connection pool exhaustion on Scylla with high shard counts.

TokenAwarePolicyTest — disable tablets for composite-key routing test — after the NTS migration, Scylla creates keyspaces with tablets enabled by default. The 3.x driver's tablet-aware getReplicas() then routes via the tablet map rather than the token map, breaking the test's hardcoded expectation that token 4881097376275569167 for composite key (1,2) maps to node 1. Fix: create the keyspace with AND tablets = {'enabled': false} to force deterministic token-map routing. This fix is also added to the driver in scylladb/java-driver#876.

scylla/3.11.4.0 (updated patch)

SimpleStrategy → NTS migration only (DC name: datacenter1), same set of files as 3.11.5.14 minus the CCMBridge/SessionStressTest/TokenAwarePolicyTest changes (those are not needed for 3.11.4.0 which predates tablet support in the driver).

Not covered

scylla/3.11.5.12 and scylla/3.11.5.13 — these versions also have SimpleStrategy in TestUtils.CREATE_KEYSPACE_SIMPLE_FORMAT and no existing patch to override it. They will fail the same way on modern Scylla. Since the framework selects the most recent patch version and 3.11.5.14 is now covered, these are lower priority but should be addressed if they are included in the test matrix.

Verified

Each patch was applied to a clean worktree at the corresponding tag and compiled successfully with mvn compile. The two remaining failures from the previous Jenkins run (SessionStressTest, TokenAwarePolicyTest) were reproduced locally against Scylla 2026.1.0 and confirmed passing with the fixes applied.

Full matrix validation (scylla 3.x × 2 versions, scylla 4.x × 2 versions, datastax 4.x × 2 versions) is running in Jenkins build #19.

Corresponding driver fixes

@nikagra nikagra force-pushed the fix/simple-strategy-to-nts branch 4 times, most recently from 054be52 to 4d7f266 Compare April 23, 2026 08:30
@nikagra nikagra changed the title fix: replace SimpleStrategy with NetworkTopologyStrategy in all 4.x patches fix: replace SimpleStrategy with NetworkTopologyStrategy in patches Apr 23, 2026
@nikagra nikagra force-pushed the fix/simple-strategy-to-nts branch from f4ff0c9 to 99fe6d8 Compare April 24, 2026 14:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates version-specific patchsets used by the matrix test framework to avoid ScyllaDB failures caused by SimpleStrategy being incompatible with tablets, by switching integration-test keyspace creation to NetworkTopologyStrategy.

Changes:

  • Replace SimpleStrategy with NetworkTopologyStrategy in keyspace creation across 4.x (DataStax + Scylla) and 3.x Scylla driver patchsets.
  • Add a new Scylla 3.x patch (3.11.5.14) including CCM compatibility fixes and a Metadata.getReplicas(...) fallback adjustment for tablet-backed keyspaces.
  • Add a Scylla 3.x ignore.yaml to skip known-incompatible tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
versions/scylla/4.19.0.8/patch Switches integration-test keyspace replication to NTS (dc1) and updates related assertions/usages in the 4.19.0.8 patchset.
versions/scylla/4.18.1.0/patch Switches integration-test keyspace replication to NTS (dc1) and updates related assertions/usages in the 4.18.1.0 patchset.
versions/datastax/4.19.2/patch Switches integration-test keyspace replication to NTS (dc1) and updates assertions in the 4.19.2 patchset.
versions/datastax/4.19.1/patch Switches integration-test keyspace replication to NTS (dc1) and updates assertions in the 4.19.1 patchset.
versions/scylla/3.11.5.14/patch New 3.x Scylla patch: NTS migration (datacenter1) plus additional CCM/metadata/test adjustments for modern Scylla.
versions/scylla/3.11.5.14/ignore.yaml New ignore list for tests known to be incompatible/unreliable on Scylla for this version.
versions/scylla/3.11.4.0/patch Applies NTS migration (datacenter1) and related test adjustments for this 3.x patchset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread versions/scylla/4.19.0.8/patch
Comment thread versions/scylla/3.11.5.14/ignore.yaml Outdated
Comment thread versions/scylla/3.11.5.14/ignore.yaml Outdated
Replace SimpleStrategy with NetworkTopologyStrategy (datacenter1) in all
integration test keyspace creation statements across all tested 4.x driver
versions (datastax/4.19.1, datastax/4.19.2, scylla/4.18.1.0, scylla/4.19.0.8).

Scylla PR scylladb/scylladb#25342 made SimpleStrategy throw
InvalidConfigurationInQueryException when tablets are globally enabled
(the default on recent Scylla), causing ~100 cascading test failures per
driver version originating from SessionUtils.createKeyspace().

Key files changed in each patch:
- SessionUtils.java (central fix)
- SchemaChangesIT (CQL + assertion: datacenter1 key, no hasSize(2))
- TokenITBase, SimpleStatementCcmIT
- LWTLoadBalancingIT, MailboxServiceImpl (scylla driver versions only)
- DefaultKeyspaceIT, QueryKeyspaceAndTableIT (mapper tests)
@nikagra nikagra force-pushed the fix/simple-strategy-to-nts branch 2 times, most recently from d183fbf to 7b0d049 Compare May 4, 2026 18:20
@nikagra nikagra force-pushed the fix/simple-strategy-to-nts branch from 7b0d049 to 7f0ceaa Compare May 5, 2026 09:30
@dkropachev dkropachev merged commit 0644afb into scylladb:master May 5, 2026
@nikagra nikagra deleted the fix/simple-strategy-to-nts branch May 5, 2026 15:37
nikagra added a commit to nikagra/scylla-java-driver-matrix that referenced this pull request May 15, 2026
Scylla 2025.4.x enables tablets by default for all replication strategies.
Counters, secondary indexes, and materialized views are not supported on
tables with tablets, causing 6 tests to fail in driver versions 3.11.4.0
and 3.11.5.15.

Changes:
- versions/scylla/3.11.4.0/patch: add central CCMTestsSupport.initTestKeyspace()
  override that appends AND tablets = {'enabled': false} when running against
  Scylla (ccm().getScyllaVersion() != null), fixing IndexMetadataTest,
  TableMetadataTest, QueryBuilderExecutionTest, and SessionTest failures.
- versions/scylla/3.11.5.15/patch: replace with full NTS conversion (from
  3.11.5.14) plus the same central initTestKeyspace() tablets fix. The previous
  3.11.5.15 patch was missing all NTS and tablets changes introduced by PR scylladb#141
  for 3.11.5.14, because version resolution picks the exact-match directory.
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