[ 
https://issues.apache.org/jira/browse/CASSANDRA-18111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871605#comment-17871605
 ] 

Stefan Miklosovic edited comment on CASSANDRA-18111 at 8/9/24 7:42 AM:
-----------------------------------------------------------------------

[~paulo] I have done further improvements:

1) based on the thread (1) I moved forward and I created SnapshotManagerMBean. 
I kept StorageServiceMBean methods related to snapshots in place, I just 
delegated everything to SnapshotManager which implements this new MBean
2) I have also aligned nodetool commands related to snapshots (snapshot, 
listsnapshots, clearsnapshot) so they call new SnapshotManagerMBean instead of 
StorageServiceMBean
3) I have merged / simplified the logic around takeSnapshot and 
takeMultipleTableSnapshot, only one version of that method is used.
4) All methods mentioned in your goal 2, A, are moved as well
5) I started to put manifest to each directory of a snapshot, but each such 
manifest contains all data components, as it was before, not only these which 
are located in that directory (I rolled back what I introduced)

The only thing which is not resolved is what to do with the period check / 
inotify stuff. I am not completely sure where you see the complexity risks. 
However if you want to do that by a thread, I would rather incline to not doing 
it at all and it would be up to an operator to refresh that manually. 

(1) https://lists.apache.org/thread/wg9y951b93objm7cnx08o5f9fro3y3zj


was (Author: smiklosovic):
[~paulo] I have done further improvements:

1) based on the thread (1) I moved forward and I created SnapshotManagerMBean. 
I kept StorageServiceMBean methods related to snapshots in place, I just 
delegated everything to SnapshotManager which implements this new MBean
2) I have also aligned nodetool commands related to snapshots (snapshot, 
listsnapshots, clearsnapshot) so they call new SnapshotManagerMBean instead of 
StorageServiceMBean
3) I have merged / simplified the logic around takeSnapshot and 
takeMultipleTableSnapshot, only one version of that method is used.
4) All methods mentioned in your goal 2, A, are moved as well
5) I started to put manifest to each directory of a snapshot, but each such 
manifest contains all data components, as it was before, not only these which 
are located in that directory (I rolled back what I introduced)

The only thing which is not resolved is what to do with the period check / 
inotify stuff. I am not completely sure where you see the complexity risks. 
However if you want to do that by a thread, I would rather incline to not doing 
it at all and it would be up to an operator to refresh that manually. 

> Centralize all snapshot operations to SnapshotManager and cache snapshots
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18111
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18111
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/Snapshots
>            Reporter: Paulo Motta
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 5.x
>
>          Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> Everytime {{nodetool listsnapshots}} is called, all data directories are 
> scanned to find snapshots, what is inefficient.
> For example, fetching the 
> {{org.apache.cassandra.metrics:type=ColumnFamily,name=SnapshotsSize}} metric 
> can take half a second (CASSANDRA-13338).
> This improvement will also allow snapshots to be efficiently queried via 
> virtual tables (CASSANDRA-18102).
> In order to do this, we should:
> a) load all snapshots from disk during initialization
> b) keep a collection of snapshots on {{SnapshotManager}}
> c) update the snapshots collection anytime a new snapshot is taken or cleared
> d) detect when a snapshot is manually removed from disk.



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

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

Reply via email to