You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Billy Pearson (JIRA)" <ji...@apache.org> on 2008/02/10 00:04:08 UTC

[jira] Created: (HBASE-433) region server should deleted restore log after successfull restore

region server should deleted restore log after successfull restore
------------------------------------------------------------------

                 Key: HBASE-433
                 URL: https://issues.apache.org/jira/browse/HBASE-433
             Project: Hadoop HBase
          Issue Type: Bug
          Components: regionserver
            Reporter: Billy Pearson
            Priority: Trivial
             Fix For: 0.2.0


Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.

Suggestion would be to remove after we successfully flush of all the edits to a mapfile

so something like:
replay log 
memcache flush
deleted log




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman updated HBASE-433:
--------------------------------

    Status: Patch Available  (was: Open)

Please review.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567390#action_12567390 ] 

Jim Kellerman commented on HBASE-433:
-------------------------------------

Current situation:

If a region server crashes before it has closed any log files, then all it will leave is one zero length log file which will be ignored.

However, if the region server crashes after closing one or more log files, and the region server was starting up a region that had an old log file (and the region server crashed before recovering the old log file), then yes, the old log file would be overwritten.

Solution for current situation:

HLog.splitLog should check for the presence of an existing log file, and copy its contents into a new file before processing the region server's log file(s).

Future (when HDFS has appends):

The region server will never leave a zero length log file unless it has received no updates since it started or since it closed the most recent log file.

Solution for future:

If HDFS supports appends to an existing file, then splitLog should open the region's old log file for append or create it if it does not exist.

If HDFS does not support appends to an existing file, then the solution for the current situation would still work.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>            Reporter: Billy Pearson
>            Priority: Trivial
>             Fix For: 0.2.0
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman updated HBASE-433:
--------------------------------

    Attachment: patch.txt

Same as before, but don't do the math if you aren't going to use it.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt, patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman reassigned HBASE-433:
-----------------------------------

    Assignee: Jim Kellerman

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Trivial
>             Fix For: 0.2.0
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman resolved HBASE-433.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.2.0

Committed to 0.1 and trunk.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0, 0.2.0
>
>         Attachments: patch.txt, patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman updated HBASE-433:
--------------------------------

    Status: Open  (was: Patch Available)

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Billy Pearson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567373#action_12567373 ] 

Billy Pearson commented on HBASE-433:
-------------------------------------

might also take a look at what point the master sees a region as crashed from a region server

example

say I have a failed region server and master loads and saves restore logs for each region 

on the reopen of a region and say it replaying the logs and crashes 

Would the master overwrite the old log file with a new one or would the master not consider the region as part of the region server on a crash until it receives an MSG_REPORT_PROCESS_OPEN message?
Should look in to this so we do not have a risk of over writing a restore log file that has not successfully loaded and flushed to disk.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>            Reporter: Billy Pearson
>            Priority: Trivial
>             Fix For: 0.2.0
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman updated HBASE-433:
--------------------------------

        Fix Version/s:     (was: 0.2.0)
                       0.1.0
             Priority: Blocker  (was: Trivial)
    Affects Version/s: 0.1.0

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577867#action_12577867 ] 

Jim Kellerman commented on HBASE-433:
-------------------------------------

Good point. I had just cut and pasted from below, but you're right. Why do the math if you aren't going to use the results? I'll change that before I check it in.


> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577709#action_12577709 ] 

Bryan Duxbury commented on HBASE-433:
-------------------------------------

Silly comment, but should the math happen after the LOG.isDebugEnabled() so that when not in debug we don't do the math on HLog:586?

Tests pass, code looks pretty good. +1

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Billy Pearson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577661#action_12577661 ] 

Billy Pearson commented on HBASE-433:
-------------------------------------

I would test but my test cluster is in route to the data center. someone could hard kill a region server and see if the logs get removed after the region recovers.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman updated HBASE-433:
--------------------------------

    Attachment: patch.txt

HLog
- don't overwrite oldlogfile in splitLog if it already exists. Rename it and copy it into the new oldlogfile. Then delete it once it has been copied.
- use FileUtil.fullyDelete to delete region server log directory.

HRegion
- delete oldlogfile once it has been successfully processed


> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.1.0
>            Reporter: Billy Pearson
>            Assignee: Jim Kellerman
>            Priority: Blocker
>             Fix For: 0.1.0
>
>         Attachments: patch.txt
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-433) region server should deleted restore log after successfull restore

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567391#action_12567391 ] 

Jim Kellerman commented on HBASE-433:
-------------------------------------

And yes, the region server should delete the old log file once it has been completely recovered and flushed.

> region server should deleted restore log after successfull restore
> ------------------------------------------------------------------
>
>                 Key: HBASE-433
>                 URL: https://issues.apache.org/jira/browse/HBASE-433
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: regionserver
>            Reporter: Billy Pearson
>            Priority: Trivial
>             Fix For: 0.2.0
>
>
> Currently we do not remove the restore log "oldlogfile.log" after we reopen a region after a crashed region server.
> Suggestion would be to remove after we successfully flush of all the edits to a mapfile
> so something like:
> replay log 
> memcache flush
> deleted log

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.