[ 
https://issues.apache.org/jira/browse/HDDS-17182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng resolved HDDS-17182.
-------------------------------
    Fix Version/s: 2.3.0
       Resolution: Fixed

> Check key prefix and container ID when importing a container
> ------------------------------------------------------------
>
>                 Key: HDDS-17182
>                 URL: https://issues.apache.org/jira/browse/HDDS-17182
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: Ozone Datanode
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.3.0
>
>
> When a datanode imports a container with schema V3, 
> {{DatanodeStoreSchemaThreeImpl.loadKVContainerData}} writes every key of the 
> RocksDB dump files in the archive into the volume's shared DB. Exporting 
> ({{dumpKVContainerData}}) and cleanup ({{removeKVContainerData}}) are limited 
> to the container's key prefix, but loading does not check it. 
> {{ContainerImporter}} also takes the container ID from the {{.container}} 
> file in the archive without comparing it with the requested container ID.
> This change:
> * Passes the container ID to {{loadKVContainerData}}, which fails on the 
> first key outside that container's key prefix. The check runs before the 
> batch is committed, so a failed load writes nothing.
> * Makes {{ContainerImporter}} reject an archive whose container ID differs 
> from the requested one ({{INVALID_ARGUMENT}}).
> Compatibility:
> * No protocol, layout or configuration change.
> * Archives exported by datanodes are not affected, since they contain only 
> keys of the exported container under its own ID.



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

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

Reply via email to