hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fangyuan Deng (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HBASE-18273) hbase_rotate_log in hbase-daemon.sh script not working for some JDK
Date Wed, 28 Jun 2017 03:02:00 GMT

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

Fangyuan Deng edited comment on HBASE-18273 at 6/28/17 3:01 AM:
----------------------------------------------------------------

simplify the check,

if [ ! -f "$log" ] && [ -f "$log.0" ]; then #for some jdk, gc log has a suffix 0
mv -f "$log.0" "$log";
fi



was (Author: whisper_deng):
simplify the check,

if [ ! -f "$log" ] && [ -f "$log.0" ]; then #for some jdk, gc log has a postfix 0
mv -f "$log.0" "$log";
fi


> hbase_rotate_log in hbase-daemon.sh script not working for some JDK
> -------------------------------------------------------------------
>
>                 Key: HBASE-18273
>                 URL: https://issues.apache.org/jira/browse/HBASE-18273
>             Project: HBase
>          Issue Type: Bug
>          Components: hbase
>    Affects Versions: 1.2.6, 1.1.11, 2.0.0-alpha-1
>            Reporter: Fangyuan Deng
>             Fix For: 2.0.0-beta-2
>
>         Attachments: HBASE-18273.0.patch, HBASE-18273.1.patch
>
>
> When restarting a hbase process,  hbase_rotate_log $HBASE_LOGGC will rotate GC logs.
> the code looks like this,
>  if [ -f "$log" ]; then # rotate logs
>     while [ $num -gt 1 ]; do
>         prev=`expr $num - 1`
>         [ -f "$log.$prev" ] && mv -f "$log.$prev" "$log.$num"
>         num=$prev
>     done
> But, some version JDK will add a postfix .0 to the gc file, like hbase-xxx.gc.0,  rather
than hbase-xxx.gc.
> So I add a check before rotate,
>  if [ ! -f "$log" ]; then #for some jdk, gc log has a postfix 0
>       if [ -f "$log.0" ]; then
>         mv -f "$log.0" "$log";
>       fi
>     fi



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message