Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
df48e01
LIHADOOP-48527 Magnet shuffle service block transfer netty protocol
Victsm May 9, 2020
6472267
LIHADOOP-53438 Using different appId for the tests in RemoteBlockPush…
otterc May 12, 2020
1c78e1d
LIHADOOP-53496 Not logging all block push exceptions on the client
otterc May 15, 2020
71f3246
LIHADOOP-53700 Separate configuration for caching the merged index fi…
zhouyejoe Jun 1, 2020
221178f
LIHADOOP-53940 Logging the data file and index file path when shuffle…
otterc Jun 10, 2020
55b4a5f
LIHADOOP-54059 LIHADOOP-53496 Handle the inconsistencies between loc…
otterc Jun 15, 2020
f9d0e86
LIHADOOP-54379 Sorting the disks both on shuffle service and executors
otterc Jun 24, 2020
548e2c0
LIHADOOP-52494 Magnet fallback to origin shuffle blocks when fetch of…
otterc Jul 24, 2020
50efba9
LIHADOOP-55372 reduced the default for minChunkSizeInMergedShuffleFile
otterc Aug 26, 2020
8a6e01b
LIHADOOP-55315 Avoid network when fetching merged shuffle file in loc…
zhouyejoe Sep 9, 2020
ae5ffac
LIHADOOP-55654 Duplicate application init calls trigger NPE and wrong…
zhouyejoe Sep 12, 2020
e51042b
Further prune changes that should go into a later PR.
Victsm Sep 23, 2020
83aca99
LIHADOOP-54379 Sorting the disks both on shuffle service and executors
otterc Jun 24, 2020
04e0efe
LIHADOOP-55022 Disable the merged shuffle file cleanup in stopApplica…
zhouyejoe Aug 11, 2020
71dfd48
Tests and cleanup
otterc Oct 6, 2020
0c411c1
LIHADOOP-55948 Failure in the push stream should not change the curre…
otterc Oct 1, 2020
d029463
Minor style corrections
otterc Oct 15, 2020
8f3839f
Fixed style issues
otterc Oct 15, 2020
1cd2d03
Renamed variables, methods, fixed indentation, addressed other review…
otterc Oct 19, 2020
3356c19
Addressing review comments
otterc Oct 23, 2020
d879beb
Changed the partitions map and addressed other review comments
otterc Oct 26, 2020
48ae819
Added support for subdirs under merge_manager dirs and removed the ya…
otterc Oct 28, 2020
9b031f7
Addressed test failure and other review comments in RemoteBlockPushRe…
otterc Oct 29, 2020
807cc7b
Minor change in finalization
otterc Oct 29, 2020
5b169bc
Removing the partition from inner map after the files are closed
otterc Oct 30, 2020
9ece587
Server side configuration to specify the implementation of MergedShuf…
otterc Oct 30, 2020
d13c7ad
Change the Push block stream to not encode shuffle Id, map index, and…
otterc Nov 2, 2020
63843bb
Fixed typos, address review comments, made NoOp the default impl, and…
otterc Nov 2, 2020
d35aa4b
Addressed review comments
otterc Nov 3, 2020
ba92311
Fix IndexOutOfBoundsException and avoid instantiating AppsPathInfo mu…
otterc Nov 4, 2020
9be25b3
Removed duplicate declaration of shuffle push prefix
otterc Nov 4, 2020
ba51796
Added UT for collision with 2 streams
otterc Nov 4, 2020
1f4fcfe
Removed unnecessary TODOs, marked MergedShuffleFileManager evolving, …
otterc Nov 4, 2020
28edaae
Changed the serialization on chunktracker and removed serializedSizeI…
otterc Nov 6, 2020
cb1881c
Use RandomAccessFile
otterc Nov 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
LIHADOOP-55654 Duplicate application init calls trigger NPE and wrong…
… local dirs update in shuffle service. Also fixing a memory leak.

RB=2281730
BUG=LIHADOOP-55654
G=spark-reviewers
R=vsowrira,chsingh,mshen
A=vsowrira,chsingh
  • Loading branch information
zhouyejoe authored and otterc committed Nov 6, 2020
commit ae5ffac10685a2e283953580bdd9793ba22116a3
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ private File getFile(String appId, String filename) {
String relativePath = getRelativePath(appPathsInfo.user, appId);
Path filePath = localDir.resolve(relativePath);
File targetFile = new File(filePath.toFile(), filename);
logger.info("Get the file for " + targetFile.getAbsolutePath());
logger.debug("Get the file for {}", targetFile.getAbsolutePath());
return targetFile;
}

private Path[] getActiveLocalDirs(String[] activeLocalDirs) {
return Arrays.stream(activeLocalDirs)
.map(localDir -> Paths.get(localDir)).toArray(Path[]::new);
Preconditions.checkNotNull(activeLocalDirs,
"Active local dirs list has not been updated by any executor registration");
return
Arrays.stream(activeLocalDirs).map(localDir -> Paths.get(localDir)).toArray(Path[]::new);
}

private String getRelativePath(String user, String appId) {
Expand All @@ -240,7 +242,11 @@ public String[] getMergedBlockDirs(String appId) {
AppPathsInfo appPathsInfo = Preconditions.checkNotNull(
appsPathInfo.get(appId),
"application " + appId + " is not registered or NM was restarted.");
return Arrays.stream(appPathsInfo.activeLocalDirs)
String[] activeLocalDirs = Preconditions.checkNotNull(
appsPathInfo.get(appId).activeLocalDirs,
"application " + appId +
" active local dirs list has not been updated by any executor registration");
return Arrays.stream(activeLocalDirs)
.map(dir -> dir + getRelativePath(appPathsInfo.user, appId))
.toArray(String[]::new);
}
Expand All @@ -250,7 +256,7 @@ public void applicationRemoved(String appId, boolean cleanupLocalDirs) {
logger.info("Application {} removed, cleanupLocalDirs = {}", appId, cleanupLocalDirs);
// TODO: Change the message when this service is able to handle NM restart
AppPathsInfo appPathsInfo = Preconditions.checkNotNull(
appsPathInfo.get(appId),
appsPathInfo.remove(appId),
"application " + appId + " is not registered or NM was restarted.");
Iterator<Map.Entry<AppShufflePartitionId, AppShufflePartitionInfo>> iterator =
partitions.entrySet().iterator();
Expand Down Expand Up @@ -619,7 +625,7 @@ public MergeStatuses finalizeShuffleMerge(FinalizeShuffleMerge msg) throws IOExc
@Override
public void registerApplication(String appId, String user) {
logger.debug("register application with RemoteBlockPushResolver {} {}", appId, user);
appsPathInfo.put(appId, new AppPathsInfo(user));
appsPathInfo.putIfAbsent(appId, new AppPathsInfo(user));
}

@Override
Expand Down Expand Up @@ -840,7 +846,8 @@ private AppPathsInfo updateActiveLocalDirs(
activeLocalDirs = Arrays.stream(localDirs)
.map(localDir -> localDir.substring(0, localDir.indexOf(relativePath)))
.toArray(String[]::new);
logger.info("Updated the active local dirs " + Arrays.toString(activeLocalDirs));
logger.info("Updated the active local dirs {} for application {}",
Arrays.toString(activeLocalDirs), appId);
}
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void testNoIndexFile() {
try {
String appId = "app_NoIndexFile";
registerApplication(appId, USER);
registerExecutor(appId, prepareBlockManagerLocalDirs(appId, USER, localDirs));
pushResolver.getMergedBlockMeta(appId, 0, 0);
removeApplication(appId);
} catch (Throwable t) {
Expand Down Expand Up @@ -162,6 +163,37 @@ public void testAppUsingFewerLocalDirs() throws IOException {
removeApplication(appId);
}

@Test(expected = NullPointerException.class)
public void testUpdateLocalDirsOnlyOnce() throws IOException {
String appId = "app_App1";
// First app init and executor register will store the active local dirs list
registerApplication(appId, USER);
String[] activeLocalDirs = Arrays.stream(localDirs).skip(1).toArray(String[]::new);
registerExecutor(appId, prepareBlockManagerLocalDirs(appId, USER, activeLocalDirs));
assertEquals(pushResolver.getMergedBlockDirs(appId).length, 1);
assertTrue(pushResolver.getMergedBlockDirs(appId)[0].contains(
"l2/usercache/testuser/appcache/app_App1/merge_manager"));
// Any later app init or executor register from the same application
// won't change the active local dirs list
registerApplication(appId, USER);
assertEquals(pushResolver.getMergedBlockDirs(appId).length, 1);
assertTrue(pushResolver.getMergedBlockDirs(appId)[0].contains(
"l2/usercache/testuser/appcache/app_App1/merge_manager"));
activeLocalDirs = Arrays.stream(localDirs).toArray(String[]::new);
registerExecutor(appId, prepareBlockManagerLocalDirs(appId, USER, activeLocalDirs));
assertEquals(pushResolver.getMergedBlockDirs(appId).length, 1);
assertTrue(pushResolver.getMergedBlockDirs(appId)[0].contains(
"l2/usercache/testuser/appcache/app_App1/merge_manager"));
removeApplication(appId);
try {
pushResolver.getMergedBlockDirs(appId);
} catch (Throwable e) {
assertTrue(e.getMessage()
.startsWith("application app_App1 is not registered or NM was restarted."));
Throwables.propagate(e);
}
}

/**
* Registers the app with RemoteBlockPushResolver. Use a different appId for different tests.
* This is because when the application gets removed, the directory cleaner removes the merged
Expand Down