devmadhuu opened a new pull request, #12185:
URL: https://github.com/apache/ozone/pull/12185

   What changes were proposed in this pull request?
   
   When SCM repairs an EC container's replicas, it now places the copies on the 
container's storage tier instead of any volume. This is the EC half of split F; 
the RATIS half landed in HDDS-17536 (#12063), and this change mirrors it for EC.
   
   Before this PR, EC replica repair ignored storage policy:
   - ECUnderReplicationHandler selected copy targets with StorageType.DEFAULT 
and sent the copy command with no storage type.
   - ECMisReplicationHandler did the same.
   
   So an EC container whose policy asked for SSD could have a decommission, 
maintenance, or mis-replication copy land on a DISK volume, silently drifting 
off its tier.
   
   This PR:
   - EC under-replication copies (decommission and maintenance paths in 
ECUnderReplicationHandler): select targets of the container's tier, and fall 
back SSD→DISK when no SSD target exists — the same rule RATIS repair uses 
(ReplicationManagerUtil.getFallbackStorageType). The resolved type is carried 
in both the replicate command and the pending ADD, so SCM accounts the space 
against the tier actually used.
   - EC mis-replication (MisReplicationHandler + ECMisReplicationHandler): copy 
to the container's tier, with no fallback. A mis-replicated container already 
has all its replicas, so a different-tier copy would only be deleted by 
over-replication and never moved back.
   - A container with no tier resolves to StorageType.DEFAULT, exactly as 
before — old containers behave unchanged.
   
   Out of scope (tracked separately):
   - EC reconstruction (rebuilding missing fragments by decode) still uses 
StorageType.DEFAULT; its tier is HDDS-16676. A comment in 
ECReconstructionCoordinator/ECUnderReplicationHandler points there.
   - The SCM successful-fallback metric is HDDS-17914.
   - Inferring a tier from a legacy replica's reported volume type when the 
container tier is null is a later design item.
   
   Example
   
   HOT policy (creation tier SSD), an EC rs-3-2 container, index 1 on a 
datanode being decommissioned:
   
   
┌──────────────────────────────────────────┬───────────────────────────┬───────────────────────────────┐
   │                                          │          Before           │     
        After             │
   
├──────────────────────────────────────────┼───────────────────────────┼───────────────────────────────┤
   │ Target selected for the copy             │ any volume (DEFAULT)      │ an 
SSD datanode               │
   
├──────────────────────────────────────────┼───────────────────────────┼───────────────────────────────┤
   │ If no SSD target is available            │ n/a (never asked for SSD) │ 
falls back to a DISK datanode │
   
├──────────────────────────────────────────┼───────────────────────────┼───────────────────────────────┤
   │ Copy command / pending ADD storage type  │ none                      │ SSD 
(or DISK on fallback)     │
   
├──────────────────────────────────────────┼───────────────────────────┼───────────────────────────────┤
   │ Mis-replication copy of an SSD container │ DEFAULT                   │ 
SSD, no fallback              │
   
└──────────────────────────────────────────┴───────────────────────────┴───────────────────────────────┘
   
   So a decommission copy of a HOT EC container now stays on SSD; only if the 
cluster has no SSD room does it fall back to DISK, instead of landing anywhere.
   
   What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17592
   
   How was this patch tested?
   
   New unit tests mirroring the RATIS repair tests:
   - TestECUnderReplicationHandler.testDecommissionCopyPreservesStorageTier — 
an SSD container's decommission copy targets SSD and the command carries SSD.
   - TestECUnderReplicationHandler.testDecommissionCopyFallsBackSsdToDisk — 
when no SSD target exists, the copy falls back to DISK.
   - TestECMisReplicationHandler.testMisReplicationPreservesStorageTier — 
mis-replication selects and copies to the container's tier and does not fall 
back.
   
   The maintenance-copy path uses the same target-selection and command code as 
decommission, so it is covered by those tests.
   
   Ran the affected server-scm replication tests 
(TestECUnderReplicationHandler, TestECMisReplicationHandler, 
TestRatisUnderReplicationHandler, TestRatisMisReplicationHandler, 
TestReplicationManagerUtil)
   ---
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to