You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "kamalesh0406 (via GitHub)" <gi...@apache.org> on 2023/01/22 02:18:00 UTC

[GitHub] [cassandra] kamalesh0406 opened a new pull request, #2107: Fix testReload in CompactionStrategyManagerBoundaryReloadTest

kamalesh0406 opened a new pull request, #2107:
URL: https://github.com/apache/cassandra/pull/2107

   ```
   [CASSANDRA-18144] Fix failing testReload in CompactionStrategyManagerBoundaryReloadTest
   
   This PR fixes this test. The issue seemed to be setting `ByteOrderedPartitioner.BytesToken` instead of a LongToken. 
   
   patch by Kamalesh Palanisamy
   
   Co-authored-by: Kamalesh Palanisamy <ka...@gmail.com>
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cassandra] kamalesh0406 closed pull request #2107: Fix testReload in CompactionStrategyManagerBoundaryReloadTest

Posted by "kamalesh0406 (via GitHub)" <gi...@apache.org>.
kamalesh0406 closed pull request #2107: Fix testReload in CompactionStrategyManagerBoundaryReloadTest
URL: https://github.com/apache/cassandra/pull/2107


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cassandra] jonmeredith commented on a diff in pull request #2107: Fix testReload in CompactionStrategyManagerBoundaryReloadTest

Posted by "jonmeredith (via GitHub)" <gi...@apache.org>.
jonmeredith commented on code in PR #2107:
URL: https://github.com/apache/cassandra/pull/2107#discussion_r1123513964


##########
test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerBoundaryReloadTest.java:
##########
@@ -67,11 +68,10 @@ public void testReload() throws UnknownHostException
         List<List<AbstractCompactionStrategy>> strategies = cfs.getCompactionStrategyManager().getStrategies();
         DiskBoundaries db = cfs.getDiskBoundaries();
         TokenMetadata tmd = StorageService.instance.getTokenMetadata();
-        byte[] tk1 = new byte[1], tk2 = new byte[1];
-        tk1[0] = 2;
-        tk2[0] = 1;
-        tmd.updateNormalToken(new ByteOrderedPartitioner.BytesToken(tk1), InetAddressAndPort.getByName("127.0.0.1"));
-        tmd.updateNormalToken(new ByteOrderedPartitioner.BytesToken(tk2), InetAddressAndPort.getByName("127.0.0.2"));
+        Token tk1 = new Murmur3Partitioner.LongToken(0);
+        Token tk2 = new Murmur3Partitioner.LongToken(Long.MAX_VALUE - 1);
+        tmd.updateNormalToken(tk1, InetAddressAndPort.getByName("127.0.0.1"));
+        tmd.updateNormalToken(tk2, InetAddressAndPort.getByName("127.0.0.2"));

Review Comment:
   ```suggestion
           tmd.updateNormalToken(tmd.partitioner.getMinimumToken(),
                                 InetAddressAndPort.getByName("127.0.0.1"));
           tmd.updateNormalToken(tmd.partitioner.getMaximumToken(),
                                 InetAddressAndPort.getByName("127.0.0.2"));```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cassandra] jonmeredith commented on a diff in pull request #2107: Fix testReload in CompactionStrategyManagerBoundaryReloadTest

Posted by "jonmeredith (via GitHub)" <gi...@apache.org>.
jonmeredith commented on code in PR #2107:
URL: https://github.com/apache/cassandra/pull/2107#discussion_r1123513964


##########
test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerBoundaryReloadTest.java:
##########
@@ -67,11 +68,10 @@ public void testReload() throws UnknownHostException
         List<List<AbstractCompactionStrategy>> strategies = cfs.getCompactionStrategyManager().getStrategies();
         DiskBoundaries db = cfs.getDiskBoundaries();
         TokenMetadata tmd = StorageService.instance.getTokenMetadata();
-        byte[] tk1 = new byte[1], tk2 = new byte[1];
-        tk1[0] = 2;
-        tk2[0] = 1;
-        tmd.updateNormalToken(new ByteOrderedPartitioner.BytesToken(tk1), InetAddressAndPort.getByName("127.0.0.1"));
-        tmd.updateNormalToken(new ByteOrderedPartitioner.BytesToken(tk2), InetAddressAndPort.getByName("127.0.0.2"));
+        Token tk1 = new Murmur3Partitioner.LongToken(0);
+        Token tk2 = new Murmur3Partitioner.LongToken(Long.MAX_VALUE - 1);
+        tmd.updateNormalToken(tk1, InetAddressAndPort.getByName("127.0.0.1"));
+        tmd.updateNormalToken(tk2, InetAddressAndPort.getByName("127.0.0.2"));

Review Comment:
   ```suggestion
           tmd.updateNormalToken(tmd.partitioner.getMinimumToken(),
                                 InetAddressAndPort.getByName("127.0.0.1"));
           tmd.updateNormalToken(tmd.partitioner.getMaximumToken(),
                                 InetAddressAndPort.getByName("127.0.0.2"));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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