-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDFS-16847: RBF: Prevents StateStoreFileSystemImpl from committing tmp file after encountering an IOException. #5145
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
68bb692
8cd6818
4731c71
5c7709c
49c6039
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 |
---|---|---|
|
@@ -234,6 +234,25 @@ public <T extends BaseRecord> void testInsert( | |
assertEquals(11, records2.size()); | ||
} | ||
|
||
public <T extends BaseRecord> void testInsertWithErrorDuringWrite( | ||
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. To test my above comment, you would need two iterations of the loop where the first is a failure and the second is a success. The test passes despite the issue because there is only a single write. 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. Yeah, this test doesn't capture the error I'd made. I tried changing the test to do a failure and then a success but I can't get mockito to work right. @mkuchenbecker If it is okay, I'll leave the test as it is. It exposes the original bug in the code and validate that my patch address it. |
||
StateStoreDriver driver, Class<T> recordClass) | ||
throws IllegalArgumentException, IllegalAccessException, IOException { | ||
|
||
assertTrue(driver.removeAll(recordClass)); | ||
QueryResult<T> queryResult0 = driver.get(recordClass); | ||
List<T> records0 = queryResult0.getRecords(); | ||
assertTrue(records0.isEmpty()); | ||
|
||
// Insert single | ||
BaseRecord record = generateFakeRecord(recordClass); | ||
driver.put(record, true, false); | ||
|
||
// Verify that no record was inserted. | ||
QueryResult<T> queryResult1 = driver.get(recordClass); | ||
List<T> records1 = queryResult1.getRecords(); | ||
assertEquals(0, records1.size()); | ||
} | ||
|
||
public <T extends BaseRecord> void testFetchErrors(StateStoreDriver driver, | ||
Class<T> clazz) throws IllegalAccessException, IOException { | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.