wchevreuil commented on a change in pull request #3574:
URL: https://github.com/apache/hbase/pull/3574#discussion_r686200903
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
##########
@@ -572,51 +572,15 @@ public void removeStoreFiles(String familyName,
Collection<HStoreFile> storeFile
//
===========================================================================
// Splits Helpers
//
===========================================================================
- /** @return {@link Path} to the temp directory used during split operations
*/
+ /** @return {@link Path} to the table directory for split daughters */
Path getSplitsDir() {
- return new Path(getRegionDir(), REGION_SPLITS_DIR);
+ return getTableDir();
}
public Path getSplitsDir(final RegionInfo hri) {
return new Path(getSplitsDir(), hri.getEncodedName());
}
- /**
- * Clean up any split detritus that may have been left around from previous
split attempts.
- */
- void cleanupSplitsDir() throws IOException {
- deleteDir(getSplitsDir());
- }
-
- /**
- * Clean up any split detritus that may have been left around from previous
- * split attempts.
- * Call this method on initial region deploy.
- * @throws IOException
- */
- void cleanupAnySplitDetritus() throws IOException {
- Path splitdir = this.getSplitsDir();
- if (!fs.exists(splitdir)) return;
- // Look at the splitdir. It could have the encoded names of the daughter
- // regions we tried to make. See if the daughter regions actually got made
- // out under the tabledir. If here under splitdir still, then the split
did
- // not complete. Try and do cleanup. This code WILL NOT catch the case
- // where we successfully created daughter a but regionserver crashed during
- // the creation of region b. In this case, there'll be an orphan daughter
- // dir in the filesystem. TOOD: Fix.
- FileStatus[] daughters = CommonFSUtils.listStatus(fs, splitdir, new
FSUtils.DirFilter(fs));
- if (daughters != null) {
- for (FileStatus daughter: daughters) {
- Path daughterDir = new Path(getTableDir(),
daughter.getPath().getName());
- if (fs.exists(daughterDir) && !deleteDir(daughterDir)) {
- throw new IOException("Failed delete of " + daughterDir);
- }
- }
- }
- cleanupSplitsDir();
- LOG.info("Cleaned up old failed split transaction detritus: " + splitdir);
- }
Review comment:
Since we won't be using temp dirs anymore, these methods would have no
use. Any potential failed split/merge dir would be cleaned by CatalogJanitor,
once it finds no related entry in meta for these regions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]