irods / irods_capability_storage_tiering

BSD 3-Clause "New" or "Revised" License
5 stars 10 forks source link

Replicas can be restaged to a higher (slower) tier #239

Closed alanking closed 7 months ago

alanking commented 7 months ago

Bug Report

iRODS Version, OS and Version

iRODS server: 4.3.1 Storage tiering plugin: 4.3.1

What did you try to do?

A test introduced in https://github.com/irods/irods_capability_storage_tiering/pull/234 revealed this issue. Here's the setup:

Have 3 resources which are configured as tiers in the same group:

Set preserve_replicas to true on ufs0. Set minimum_restage_tier to true on ufs1.

  1. Put an object on ufs0.
  2. Tier out to ufs2. There should be a replica 0 on ufs0 and a replica 2 on ufs2.
  3. Run iget -R ufs0 on the object.

Expected behavior

After discussing with team, the expected behavior is for nothing to happen. The replica that was fetched is already on a lower (faster) tier than the minimum restage tier, so there is no benefit to restaging it to the higher (slower) tier.

Observed behavior (including steps to reproduce, if applicable)

Replica 3 appears on ufs1, restaged from ufs0.

The restaging logic needs to ensure that the minimum restage tier is lower than the tier from which the replica is being restaged.

alanking commented 7 months ago

Looks like this check needs to be expanded to include data which is on a lower tier than the minimum restage tier:

https://github.com/irods/irods_capability_storage_tiering/blob/b50254bad08d8f24b63e91dce01c5c61f455a0ca/storage_tiering.cpp#L803-L807

trel commented 7 months ago

Agreed. Check more scenarios, and return early.