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
Possible fix and unit test. Fixes #961 #1048
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|
||
import org.apache.accumulo.server.fs.VolumeManager; | ||
import org.apache.accumulo.server.fs.VolumeManagerImpl; | ||
import org.apache.accumulo.server.log.SortedLogState; | ||
import org.apache.accumulo.tserver.log.RecoveryLogReader.SortCheckIterator; | ||
import org.apache.accumulo.tserver.logger.LogEvents; | ||
import org.apache.accumulo.tserver.logger.LogFileKey; | ||
|
@@ -177,4 +178,28 @@ public void testSortCheck() { | |
} | ||
} | ||
|
||
/** | ||
* Test a failed marker doesn't cause issues. See Github issue | ||
* https://github.com/apache/accumulo/issues/961 | ||
*/ | ||
@Test | ||
public void testFailed() throws Exception { | ||
Path manyMaps = new Path("file://" + root.getRoot().getAbsolutePath() + "/manyMaps"); | ||
fs.create(new Path(manyMaps, SortedLogState.FAILED.getMarker())).close(); | ||
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. Will other test see this file? 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. That is a good question. I will check 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. I added a delete at the end of the Test |
||
|
||
RecoveryLogReader reader = new RecoveryLogReader(fs, manyMaps); | ||
IntWritable key = new IntWritable(); | ||
BytesWritable value = new BytesWritable(); | ||
|
||
for (int i = 0; i < 1000; i++) { | ||
if (i == 10) | ||
continue; | ||
assertTrue(reader.next(key, value)); | ||
assertEquals(i, key.get()); | ||
} | ||
reader.close(); | ||
|
||
assertTrue(fs.delete(new Path(manyMaps, SortedLogState.FAILED.getMarker()))); | ||
} | ||
|
||
} |
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.
Could add this condition as an OR to the first if stmt in the for loop.
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.
I was thinking this is easier to remove, if that's what we plan on for 2.0.