-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22617 Recovered WAL directories not getting cleaned up #330
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 all commits
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 |
|---|---|---|
|
|
@@ -319,12 +319,11 @@ protected static void deleteFromFs(final MasterProcedureEnv env, | |
|
|
||
| // Archive regions from FS (temp directory) | ||
| if (archive) { | ||
| List<Path> regionDirList = regions.stream() | ||
| .filter(RegionReplicaUtil::isDefaultReplica) | ||
| .map(region -> FSUtils.getRegionDir(tempTableDir, region)) | ||
| List<Path> regionDirList = regions.stream().filter(RegionReplicaUtil::isDefaultReplica) | ||
| .map(region -> FSUtils.getRegionDirFromTableDir(tempTableDir, region)) | ||
| .collect(Collectors.toList()); | ||
| HFileArchiver.archiveRegions(env.getMasterConfiguration(), fs, mfs.getRootDir(), | ||
| tempTableDir, regionDirList); | ||
| HFileArchiver.archiveRegions(env.getMasterConfiguration(), fs, mfs.getRootDir(), tempTableDir, | ||
| regionDirList); | ||
| LOG.debug("Table '{}' archived!", tableName); | ||
| } | ||
|
|
||
|
|
@@ -348,6 +347,13 @@ protected static void deleteFromFs(final MasterProcedureEnv env, | |
| throw new IOException("Couldn't delete mob dir " + mobTableDir); | ||
| } | ||
| } | ||
|
|
||
| // Delete the directory on wal filesystem | ||
| FileSystem walFs = mfs.getWALFileSystem(); | ||
| Path tableWALDir = FSUtils.getWALTableDir(env.getMasterConfiguration(), tableName); | ||
|
Contributor
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 should already be deleted when archive table?
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. They could be on different file system. The table data are on the normal file system and these are on the wal file system. By default they are the same but they could be different, i.e, when deploying HBase on S3.
Contributor
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. Got it. |
||
| if (walFs.exists(tableWALDir) && !walFs.delete(tableWALDir, true)) { | ||
| throw new IOException("Couldn't delete table dir on wal filesystem" + tableWALDir); | ||
| } | ||
|
Contributor
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. Should we not be checking for wrong wal directory here too and deleting that if it exists?
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. Not necessary I think, at least there is no way to delete the namespace directories... So the users hava to use a script to delete the empty directories manually... |
||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? The old impl should be getRegionDirFromTableDir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are the same...
You can see the implementation of getRegionDirFromRootDir, it will first generate the tableDir...