You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Cosmin Lehene (JIRA)" <ji...@apache.org> on 2010/03/22 19:03:27 UTC
[jira] Created: (HBASE-2358) Store doReconstructionLog will fail if
oldlogfile.log is empty and won't load region
Store doReconstructionLog will fail if oldlogfile.log is empty and won't load region
------------------------------------------------------------------------------------
Key: HBASE-2358
URL: https://issues.apache.org/jira/browse/HBASE-2358
Project: Hadoop HBase
Issue Type: Bug
Components: regionserver
Affects Versions: 0.20.3
Environment: Any
Reporter: Cosmin Lehene
Assignee: Cosmin Lehene
Fix For: 0.21.0
doReconstructionLog doesn't handle empty files correctly:
{code}
FileStatus stat = this.fs.getFileStatus(reconstructionLog);
if (stat.getLen() <= 0) {
LOG.warn("Passed reconstruction log " + reconstructionLog +
" is zero-length. Deleting existing file");
fs.delete(reconstructionLog, false);
return -1;
}
{code}
Notice it actually compares the length of the array instead of the file length.
It should call getLen() and delete the file afterwards
{code}
FileStatus stat = this.fs.getFileStatus(reconstructionLog);
if (stat.getLen() <= 0) {
LOG.warn("Passed reconstruction log " + reconstructionLog +
" is zero-length. Deleting existing file");
fs.delete(reconstructionLog, false);
return -1;
}
{code}
Also. This is a situation that shouldn't happen as an empty oldlogfile.log should be deleted when HMaster does the split in HLog.splitLog().
I couldn't figure what would make it leave it there as I also see in the logs that other empty logs are deleted. This might expose a thornier situation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HBASE-2358) Store doReconstructionLog will fail
if oldlogfile.log is empty and won't load region
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack resolved HBASE-2358.
--------------------------
Resolution: Fixed
Hadoop Flags: [Reviewed]
Applied to branch and trunk. I agree that the fact that this file is zero in first place is symptom of some other problem but empty log shouldn't get in the way of our deploying a region. Thanks for the patch Cosmin.
> Store doReconstructionLog will fail if oldlogfile.log is empty and won't load region
> ------------------------------------------------------------------------------------
>
> Key: HBASE-2358
> URL: https://issues.apache.org/jira/browse/HBASE-2358
> Project: Hadoop HBase
> Issue Type: Bug
> Components: regionserver
> Affects Versions: 0.20.3
> Environment: Any
> Reporter: Cosmin Lehene
> Assignee: Cosmin Lehene
> Fix For: 0.20.4, 0.21.0
>
> Attachments: HBASE-2358.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> doReconstructionLog doesn't handle empty files correctly:
> {code}
> FileStatus stat = this.fs.getFileStatus(reconstructionLog);
> if (stat.getLen() <= 0) {
> LOG.warn("Passed reconstruction log " + reconstructionLog +
> " is zero-length. Deleting existing file");
> fs.delete(reconstructionLog, false);
> return -1;
> }
> {code}
> Notice it actually compares the length of the array instead of the file length.
> It should call getLen() and delete the file afterwards
> {code}
> FileStatus stat = this.fs.getFileStatus(reconstructionLog);
> if (stat.getLen() <= 0) {
> LOG.warn("Passed reconstruction log " + reconstructionLog +
> " is zero-length. Deleting existing file");
> fs.delete(reconstructionLog, false);
> return -1;
> }
> {code}
> Also. This is a situation that shouldn't happen as an empty oldlogfile.log should be deleted when HMaster does the split in HLog.splitLog().
> I couldn't figure what would make it leave it there as I also see in the logs that other empty logs are deleted. This might expose a thornier situation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.