-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-23197 'IllegalArgumentException: Wrong FS' on edits replay when… #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
96f5b1f
f0cb94f
f1601fd
3a5b242
57ab190
c450862
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,9 +38,11 @@ | |
| import org.apache.hadoop.fs.FileSystem; | ||
| import org.apache.hadoop.fs.Path; | ||
| import org.apache.hadoop.fs.PathFilter; | ||
| import org.apache.hadoop.hbase.HConstants; | ||
| import org.apache.hadoop.hbase.client.RegionInfo; | ||
| import org.apache.hadoop.hbase.regionserver.HStoreFile; | ||
| import org.apache.hadoop.hbase.util.Bytes; | ||
| import org.apache.hadoop.hbase.util.CommonFSUtils; | ||
| import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; | ||
| import org.apache.hadoop.hbase.util.FSUtils; | ||
| import org.apache.hadoop.hbase.util.HFileArchiveUtil; | ||
|
|
@@ -314,9 +316,21 @@ public static void archiveStoreFiles(Configuration conf, FileSystem fs, RegionIn | |
| // build the archive path | ||
| if (regionInfo == null || family == null) throw new IOException( | ||
| "Need to have a region and a family to archive from."); | ||
|
|
||
| Path storeArchiveDir = HFileArchiveUtil.getStoreArchivePath(conf, regionInfo, tableDir, family); | ||
|
|
||
| //NOTE: This extra check is needed for the exceptional scenario where we archive wal edits | ||
| // replayed, when hbase.region.archive.recovered.edits is on. Since WALs may be configured to | ||
| // use different FS than root dir, we need to make sure to pick the proper FS when deciding | ||
| // on the archiving path. | ||
| //1) If no wal dir setting, wals and root dir are on same FS, so good to go with the root dir; | ||
| //2) When we have wal dir set it will only be on different FS if "scheme://authority" is | ||
| // defined on wal path. In this case, if this is a proper store file archiving call, the passed | ||
| // FS scheme will be different from the wal dir one, and you should pick root dir as base. | ||
| String workingDir = conf.get(CommonFSUtils.HBASE_WAL_DIR); | ||
| if(workingDir == null || !workingDir.startsWith(fs.getScheme())){ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still worries me because if we ever get passed the wrong filesystem, we'll fail in the same way. It's not clear which filesystem is getting passed into this method either (tracing back up through HRegion).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So archiveStoreFiles gets called by HRegionFileSystem.removeStoreFiles and MobUtils.removeMobFiles. We are really interested on check HRegionFileSystem.removeStoreFiles, since this is the one that eventually get's passed a different FS from the actual store files one, when called from HRegion.replayRecoveredEditsIfAny. There are then the possible combinations of FS and file types to be archived:
|
||
| workingDir = conf.get(HConstants.HBASE_DIR); | ||
| } | ||
| Path rootDir = new Path(workingDir); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be a problem indeed, but being realistic, is this ever possible? I mean, how can we receive an FS that had not been set to neither |
||
| Path storeArchiveDir = HFileArchiveUtil. | ||
| getStoreArchivePathForRootDir(rootDir, regionInfo, family); | ||
| // make sure we don't archive if we can't and that the archive dir exists | ||
| if (!fs.mkdirs(storeArchiveDir)) { | ||
| throw new IOException("Could not make archive directory (" + storeArchiveDir + ") for store:" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.