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

Abhishek Singh Chouhan commented on HBASE-12816:
------------------------------------------------

This patch handles log rotation correctly when # gc log files is 1.It'll rotate 
the log files correctly even if #gc log files >1 but in that case when the JVM 
rolls the file it'll overwrite the existing rotated file.
abc.gc.0 is rotated to abc.gc.1 upon restart. But after restart when the JVM 
rolls abc.gc.0  over(lets say it reaches its size limit) it'll overwrite the 
existing abc.gc.1. The jvm GC logger is not aware of the log files already 
there.

One possible solution to this that i can think of is if we append timestamp in 
the log file.
DATE=`date +%Y-%m-%d-%H-%M`
-Xloggc:$DATE.gc.log
and then we can use GC log file rotation as is.Downside is that upon multiple 
restarts we can have many gc log files, but we can handle this in the stop 
method of hbase-daemon.sh, ie instead of calling hbase_rotate_logs on start we 
can have something like hbase_check_gc_logs which will make sure that only N gc 
log files are there.

Any thoughts on this?

Also a single GC file of considerable size (lets say 512 M ) will work 
perfectly and we wont lose any logs but then we lose on flexibility.

> GC logs are lost upon Region Server restart if GCLogFileRotation is enabled
> ---------------------------------------------------------------------------
>
>                 Key: HBASE-12816
>                 URL: https://issues.apache.org/jira/browse/HBASE-12816
>             Project: HBase
>          Issue Type: Bug
>          Components: scripts
>            Reporter: Abhishek Singh Chouhan
>            Assignee: Abhishek Singh Chouhan
>            Priority: Minor
>             Fix For: 1.0.0, 2.0.0, 0.98.10, 1.1.0
>
>         Attachments: HBASE-12816.patch
>
>
> When -XX:+UseGCLogFileRotation is used gc log files end with .gc.0 instead of 
> .gc.  hbase_rotate_log () in hbase-daemon.sh does not handle this correctly 
> and hence when a RS is restarted old gc logs are lost(overwritten).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to