Load: Fix active load reliability issues#18224
Open
Caideyipi wants to merge 2 commits into
Open
Conversation
jt2594838
reviewed
Jul 16, 2026
| }); | ||
| } | ||
| } catch (final IOException | RuntimeException e) { | ||
| org.apache.iotdb.commons.utils.FileUtils.deleteFileOrDirectory(transferDir, true); |
Comment on lines
+272
to
274
| private static boolean isTsFile(final File file) { | ||
| return file.getAbsolutePath().equals(getTsFilePath(file.getAbsolutePath())); | ||
| } |
Comment on lines
+61
to
+83
| final List<File> sourceFiles = createTsFileAndCompanions(); | ||
| for (final File sourceFile : sourceFiles) { | ||
| Files.write( | ||
| new File(targetDir, sourceFile.getName()).toPath(), | ||
| "existing".getBytes(StandardCharsets.UTF_8)); | ||
| } | ||
|
|
||
| LoadUtil.transferFilesToActiveDir(targetDir, sourceFiles, true); | ||
|
|
||
| final File[] transferDirs = targetDir.listFiles(File::isDirectory); | ||
| Assert.assertNotNull(transferDirs); | ||
| Assert.assertEquals(1, transferDirs.length); | ||
| for (final File sourceFile : sourceFiles) { | ||
| Assert.assertFalse(sourceFile.exists()); | ||
| final File transferredFile = new File(transferDirs[0], sourceFile.getName()); | ||
| Assert.assertTrue(transferredFile.exists()); | ||
| Assert.assertArrayEquals( | ||
| sourceFile.getName().getBytes(StandardCharsets.UTF_8), | ||
| Files.readAllBytes(transferredFile.toPath())); | ||
| Assert.assertArrayEquals( | ||
| "existing".getBytes(StandardCharsets.UTF_8), | ||
| Files.readAllBytes(new File(targetDir, sourceFile.getName()).toPath())); | ||
| } |
Contributor
There was a problem hiding this comment.
What is the point of the "existing" file?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Active load handoff
Scanner and loader lifecycle
Load resource cleanup
Test coverage
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR