You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "C. Scott Andreas (Jira)" <ji...@apache.org> on 2026/07/10 16:05:00 UTC

[jira] [Created] (CASSANDRA-21497) Flaky test: Reproducible failing seed in PlacementsChangeListenerTest#testPlacementChange

C. Scott Andreas created CASSANDRA-21497:
--------------------------------------------

             Summary: Flaky test: Reproducible failing seed in PlacementsChangeListenerTest#testPlacementChange
                 Key: CASSANDRA-21497
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21497
             Project: Apache Cassandra
          Issue Type: Bug
          Components: Transactional Cluster Metadata
            Reporter: C. Scott Andreas


On trunk at {{{}1332e217{}}}, {{PlacementsChangeListenerTest#testPlacementChange}} fails intermittently with "Conflicting replica added (expected unique endpoints)".

testPlacementChange builds random placements with OwnershipUtils.randomPlacements, then for each range removes the first write replica and adds a replica for endpoint .99 at that range.

randomPlacements assigns replicas via MembershipUtils.randomEndpoint, which returns 127.0.0.[1..254]. Endpoint .99 is inside that domain, so a range's write group can already contain it; removing a different replica and then adding endpoint 99 produces a duplicate, and EndpointsForRange.Builder rejects it.

The seed is System.nanoTime(), so the failure appears at a low rate. A search over 200,000 seeds reproduced it on 2,447 of them (about 1.2%).

The current test adds a full replica at endpoint .99:
`Replica add = Replica.fullReplica(MembershipUtils.endpoint(99), remove.range());`

Either excluding .99 from the domain selected for other replicas; or restricting the domain such that a valid address exists above the domain could be reasonable approaches to prevent the flake.

To reproduce this failure locally, seed OwnershipUtils#randomPlacements with j.u.Random(135L):

{{DataPlacements before = OwnershipUtils.randomPlacements(new java.util.Random(135L)).withLastModified(e);}}

Then run: {{ant test -Dtest.name=PlacementsChangeListenerTest}}

The test will fail with:
{{testPlacementChange errors with java.lang.IllegalArgumentException: Conflicting replica added (expected unique endpoints): Full(/127.0.0.99:7000,...); existing: Full(/127.0.0.99:7000,...).}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org