You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2010/03/12 02:23:27 UTC

[jira] Commented: (HBASE-2312) Possible data loss when RS goes into GC pause while rolling HLog

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

Todd Lipcon commented on HBASE-2312:
------------------------------------

Dhruba and I discussed this a little bit last night at the HBase meetup.

I agree that the proposed solution would work, but I don't really want to have to add another HDFS API here.

What about this idea:

1) RS #1 has written log.1, log.2, log.3
2) RS #1 is just about to write log.4 and enters gc pause before doing so
3) Master detects RS #1 dead
4) Master sees log.1, log.2, log.3. It then opens log.3 for append and also creates log.4 as a lock
5) RS #1 wakes up and isn't allowed to write to either log.3 or log.4 since HMaster holds both.

Alternatively, we discussed the idea of just adding a file like logs/.exclusive_lock in that directory. Whoever holds append lease on that file is allowed to write to those logs. Much simpler, no rolling, etc. What do you think?

> Possible data loss when RS goes into GC pause while rolling HLog
> ----------------------------------------------------------------
>
>                 Key: HBASE-2312
>                 URL: https://issues.apache.org/jira/browse/HBASE-2312
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: master, regionserver
>    Affects Versions: 0.20.3
>            Reporter: Karthik Ranganathan
>
> There is a very corner case when bad things could happen(ie data loss):
> 1)	RS #1 is going to roll its HLog - not yet created the new one, old one will get no more writes
> 2)	RS #1 enters GC Pause of Death
> 3)	Master lists HLog files of RS#1 that is has to split as RS#1 is dead, starts splitting
> 4)	RS #1 wakes up, created the new HLog (previous one was rolled) and appends an edit - which is lost
> The following seems like a possible solution:
> 1)	Master detects RS#1 is dead
> 2)	The master renames the /hbase/.logs/<regionserver name>  directory to something else (say /hbase/.logs/<regionserver name>-dead)
> 3)	Add mkdir support (as opposed to mkdirs) to HDFS - so that a file create fails if the directory doesn't exist. Dhruba tells me this is very doable.
> 4)	RS#1 comes back up and is not able create the new hlog. It restarts itself.

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