[
https://issues.apache.org/jira/browse/KYLIN-5715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786630#comment-17786630
]
Hongrong Cao commented on KYLIN-5715:
-------------------------------------
h2. Root Cause
As described in the description, the environment locale setting makes the diff
command output look different from English to Chinese, which is not recognized
correctly in the script, and thus the files cannot be copied correctly when
upgrading;
This is only briefly mentioned in the diff documentation.
[https://www.gnu.org/software/diffutils/manual/diffutils.html]
!image-2023-11-16-14-54-51-399.png|width=831,height=271!
Various locale files can also be found in the diff source code:
!image-2023-11-16-14-56-00-215.png|width=804,height=383!
h2. Fix Design
The upgrade script only uses the diff command in one place, to find and copy
files that exist in the old directory but not in the new one;
You can use env -i to enable an isolated environment for the diff command
there, and set the default locale to en_US to ensure that the diff command
output is in English;
{quote}env -i - LC_ALL="en_US.UTF-8" diff -qr $OLD_KYLIN_HOME $NEW_KYLIN_HOME
{quote}
> When the character set of the operating system is zh_CN.UTF-8, the
> hadoop_conf file in the KE installation directory before the upgrade cannot
> be copied using the upgrade script
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: KYLIN-5715
> URL: https://issues.apache.org/jira/browse/KYLIN-5715
> Project: Kylin
> Issue Type: Bug
> Affects Versions: 5.0-beta
> Reporter: Hongrong Cao
> Assignee: Yinghao Lin
> Priority: Critical
> Fix For: 5.0.0
>
> Attachments: image-2023-11-16-14-54-51-399.png,
> image-2023-11-16-14-56-00-215.png
>
>
> The following steps in the upgrade.sh script do not copy the old environment
> file directory successfully.
> During the execution of this script, the result of diff is "Only in" in
> Chinese, not "Only in" in English, and the script needs to match the English
> "Only in", so it fails to copy the old environment's hadoop_config directory
> successfully in this step. which is required to match the English "Only in"
> in the script, so the old environment's hadoop_conf cannot be copied
> successfully in this step.
> Upgrade scripts need to take into account that differences in the character
> set of the environment and other factors may result in commands not
> executing as expected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)