You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/07/13 16:49:17 UTC

[GitHub] [cassandra-sidecar] frankgh opened a new pull request, #33: CASSANDRASC-40 Fix search in list snapshot endpoint

frankgh opened a new pull request, #33:
URL: https://github.com/apache/cassandra-sidecar/pull/33

   This commit fixes test setup in SnapshotUtils. Because of the incorrect test setup
   the execution is providing incorrect results. For example, assume the following path
   
   /cassandra-test/data/ks/tbl/snapshots/test-snapshot
   
   The test was configuring data directories as ["/cassandra-test/data"], but in a real
   execution data directories is provided as ["/cassandra-test"]. This is causing the
   endpoint to return incorrect values in the JSON payload.
   
   Additionally, the response was providing the port for Cassandra and not the Sidecar
   port.


-- 
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-sidecar] frankgh closed pull request #33: CASSANDRASC-40 Fix search in list snapshot endpoint

Posted by GitBox <gi...@apache.org>.
frankgh closed pull request #33: CASSANDRASC-40 Fix search in list snapshot endpoint
URL: https://github.com/apache/cassandra-sidecar/pull/33


-- 
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-sidecar] frankgh commented on a diff in pull request #33: CASSANDRASC-40 Fix search in list snapshot endpoint

Posted by GitBox <gi...@apache.org>.
frankgh commented on code in PR #33:
URL: https://github.com/apache/cassandra-sidecar/pull/33#discussion_r920301917


##########
src/main/java/org/apache/cassandra/sidecar/routes/ListSnapshotFilesHandler.java:
##########
@@ -130,20 +121,18 @@ private ListSnapshotFilesResponse buildResponse(String host,
                                                     ListSnapshotFilesRequest request,
                                                     List<Pair<String, FileProps>> fileList)
     {
-        InstanceMetadata instanceMetadata = instancesConfig.instanceFromHost(host);
-        int sidecarPort = instanceMetadata.port();
-        Path dataDirPath = Paths.get(instanceMetadata.dataDirs().get(DATA_DIR_INDEX));
         ListSnapshotFilesResponse response = new ListSnapshotFilesResponse();
         String snapshotName = request.getSnapshotName();
+        int sidecarPort = configuration.getPort();
 
         for (Pair<String, FileProps> file : fileList)
         {
-            Path pathFromDataDir = dataDirPath.relativize(Paths.get(file.getLeft()));

Review Comment:
   we don't rely on relative paths here for the fix. We use the indexes counting from the end of the path to get the values instead.



-- 
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