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

Guoliang Sun commented on KYLIN-6037:
-------------------------------------

h3. Root Cause

Due to metadata adjustments in Kylin5, UPGRADE-related metadata has been 
migrated to the SYSTEM table, and the UPGRADE metadata type no longer exists. 
However, during the restore process, this case is not covered. By default, the 
system attempts to convert UPGRADE to a `MetadataType` enum, resulting in the 
error:  
`No enum constant [org.apache.kylin.common.persistence.MetadataType.UPGRADE]`.  

Further investigation reveals that the UPGRADE metadata corresponds to the 
`org.apache.kylin.metadata.upgrade.GlobalAclVersion` entity. Directly writing 
this metadata as SYSTEM-type metadata into the table violates the non-null 
constraint on the `name` field of 
`org.apache.kylin.common.persistence.resources.SystemRawResource`. Therefore, 
additional handling is required.
h3. Dev Design

To ensure compatibility with the fields of the SYSTEM-type metadata, add a 
`name` field to `GlobalAclVersion`, where `GlobalAclVersion` represents the 
content of the `content` field.  

To migrate UPGRADE metadata to SYSTEM-type metadata, add logic in 
`MigrateKEMetadataTool` to treat metadata with resource paths prefixed by 
`/_global/upgrade/` as SYSTEM-type metadata. Additionally, set the default 
value of the `name` field to `acl_version`.

> Metadata migration fails when the backup metadata contains an "upgrade" 
> directory
> ---------------------------------------------------------------------------------
>
>                 Key: KYLIN-6037
>                 URL: https://issues.apache.org/jira/browse/KYLIN-6037
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Guoliang Sun
>            Priority: Major
>




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

Reply via email to