[ 
https://issues.apache.org/jira/browse/CASSANDRA-20149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Miklosovic updated CASSANDRA-20149:
------------------------------------------
          Fix Version/s: 5.1
                             (was: 5.x)
    Source Control Link: 
https://github.com/apache/cassandra/commit/b15a1f04b61e11bc3b9719c06bffb9fa672a25cd
             Resolution: Fixed
                 Status: Resolved  (was: Ready to Commit)

> nodetool listsnapshots initiates two jmx calls unnecessarily
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-20149
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20149
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Local/Snapshots
>            Reporter: Stefan Miklosovic
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 5.1
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> listsnapshots calls jmx on two occasions
> 1) when getting trueSnapshotsSize
> 2) when getting snapshot details
> What it was doing in practice before CASSANDRA-18111 was that it was 
> essentially loading the snapshots twice hence almost double the time to list.
> What it is doing after CASSANDRA-18111 is that it still resolves sizes but in 
> a way more efficient way however it still calls jmx twice which is not 
> necessary.
> The fix consists of returning resolved sizes together with snapshot details 
> and then on the client size we just display and sum it up in case of wanting 
> to know the total. 
> It is more optimal to just return results in one response and sum few numbers 
> on the client from the results than to call jmx twice. 
> It is, actually, safer too. Because for now, total true snapshots size is 
> returned _before_ we list snapshots. So what can happen, albeit quite 
> improbably, is that a snapshot can be removed _after_ we call total true 
> snapshot size method but _before_ we list all snapshots. So that means that 
> total true disk size would be bigger than the sum of true disk sizes for all 
> snapshots after one of them was removed. 
> This also means that a user will get true raw size (raw means not human 
> friendly, human friendly is returned in the response already) of a snapshot 
> in the result of snapshot details automatically. They do not need to call 
> extra MBean method for that (which this patch opportunistically introduces 
> too).



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to