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

Devesh Kumar Singh edited comment on HDDS-17535 at 11/30/26, 5:14 AM:
----------------------------------------------------------------------

Thanks [~greenwich], I agree with *400 InsufficientStorageTier*

Two implementation notes so the code actually surfaces as 400 and not 500:
# S3ErrorTable: 400 is {{HttpURLConnection.HTTP_BAD_REQUEST}}, already used 
there, so this is a normal new entry
  {{INSUFFICIENT_STORAGE_TIER("InsufficientStorageTier", "...", 
HTTP_BAD_REQUEST)}} - no raw literal needed (unlike
  507, which is not a HttpURLConnection constant).
# OM -> S3 mapping: the new OM result code (STORAGE_TIER_UNAVAILABLE) needs its 
own case in
  {{S3ErrorTable.translateResultCode(OMException)}} returning that entry. 
Without it the switch falls through to
  {{default -> INTERNAL_ERROR}} and the client gets 500 InternalError instead 
of 400.

To map our existing *no_space/no_suitable_node* enum constant and throw 
*STORAGE_TIER_UNAVAILABLE* error code in wrapped *OMException* and then 
actually translate that with S3ErrorTable -> *400 InsufficientStorageTier* , 
you can update earlier *hdds-17535-contract-reviewd.md* doc


was (Author: JIRAUSER295411):
Thanks [~greenwich], I agree with *400 InsufficientStorageTier*

Two implementation notes so the code actually surfaces as 400 and not 500:
# S3ErrorTable: 400 is {{HttpURLConnection.HTTP_BAD_REQUEST}}, already used 
there, so this is a normal new entry
  {{INSUFFICIENT_STORAGE_TIER("InsufficientStorageTier", "...", 
HTTP_BAD_REQUEST)}} - no raw literal needed (unlike
  507, which is not a HttpURLConnection constant).
# OM -> S3 mapping: the new OM result code (STORAGE_TIER_UNAVAILABLE) needs its 
own case in
  {{S3ErrorTable.translateResultCode(OMException)}} returning that entry. 
Without it the switch falls through to
  {{default -> INTERNAL_ERROR}} and the client gets 500 InternalError instead 
of 400.

Here is the JIRA to map our existing *no_space/no_suitable_node* enum constant 
to map and throw *STORAGE_TIER_UNAVAILABLE* error code in wrapped *OMException* 
to actually translate that with S3ErrorTable -> *400 InsufficientStorageTier* 
from earlier *hdds-17535-contract-reviewd.md* doc

> Define strict and fallback storage-tier allocation contract
> -----------------------------------------------------------
>
>                 Key: HDDS-17535
>                 URL: https://issues.apache.org/jira/browse/HDDS-17535
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: Ozone Filesystem
>            Reporter: Devesh Kumar Singh
>            Assignee: Aleksei Ieshin
>            Priority: Major
>         Attachments: StoragePolicyRepairFallBackDesignContract.md, 
> hdds-17535-contract-reviewd.md
>
>
> Specify and implement preferred tier, authorized fallback, unavailable-tier 
> errors, selection reporting and interaction with RATIS/EC placement. 
> *Reason:* Even a fully upgraded cluster can be unable to satisfy placement 
> intent; finalization is not capacity validation. 
> *Acceptance criteria:* Strict requests fail when infeasible; fallback uses 
> only permitted tiers; physical choices observable; policy-free behavior 
> unchanged.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to