Skip to content

Commit 845c79f

Browse files
author
mayastor-bors
committedFeb 5, 2024
Try #1566:
2 parents 11b4689 + 73da8df commit 845c79f

File tree

7 files changed

+220
-183
lines changed

7 files changed

+220
-183
lines changed
 

‎io-engine/src/core/snapshot.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ pub trait SnapshotOps {
235235
fn list_snapshot_by_snapshot_uuid(&self) -> Vec<VolumeSnapshotDescriptor>;
236236

237237
/// List All Snapshot.
238-
fn list_all_snapshots() -> Vec<VolumeSnapshotDescriptor>;
238+
fn list_all_snapshots(
239+
parent_lvol: Option<&Lvol>,
240+
) -> Vec<VolumeSnapshotDescriptor>;
239241

240242
/// Create snapshot clone.
241243
async fn create_clone(
@@ -350,13 +352,11 @@ pub trait SnapshotOps {
350352
total_ancestor_snap_size: u64,
351353
) -> Option<u64>;
352354

353-
/// When snapshot is destroyed, reset the parent lvol usage cache and its
354-
/// successor snapshot and clone usage cache.
355-
fn reset_snapshot_parent_successor_usage_cache(&self);
356-
357-
/// When snapshot is destroyed, reset cache of successor snapshots and
358-
/// clones based on snapshot parent uuid.
359-
fn reset_successor_lvol_usage_cache(&self, snapshot_parent_uuid: String);
355+
/// Reset snapshot tree usage cache. if the lvol is replica, then reset
356+
/// cache will be based on replica uuid, which is parent uuid for all
357+
/// snapshots created from the replica. if the lvol is not replica, then
358+
/// reset cache will be judge based on lvol tree present in the system.
359+
fn reset_snapshot_tree_usage_cache(&self, is_replica: bool);
360360
}
361361

362362
/// Traits gives the Snapshots Related Parameters.

‎io-engine/src/grpc/v1/replica.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ impl From<LvolSpaceUsage> for ReplicaSpaceUsage {
118118
impl From<Lvol> for Replica {
119119
fn from(l: Lvol) -> Self {
120120
let usage = l.usage();
121-
let source_uuid =
122-
Lvol::get_blob_xattr(&l, CloneXattrs::SourceUuid.name());
121+
let source_uuid = Lvol::get_blob_xattr(
122+
l.blob_checked(),
123+
CloneXattrs::SourceUuid.name(),
124+
);
123125
Self {
124126
name: l.name(),
125127
uuid: l.uuid(),

‎io-engine/src/grpc/v1/snapshot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl SnapshotRpc for SnapshotService {
510510
} else {
511511
// if source_uuid is not input, list all snapshot
512512
// present in system
513-
snapshots = Lvol::list_all_snapshots()
513+
snapshots = Lvol::list_all_snapshots(None)
514514
.into_iter()
515515
.map(SnapshotInfo::from)
516516
.collect();

0 commit comments

Comments
 (0)