TestLogRolling's low-probability failure
-----------------------------------------
Key: HBASE-4252
URL: https://issues.apache.org/jira/browse/HBASE-4252
Project: HBase
Issue Type: Bug
Components: regionserver
Affects Versions: 0.90.4
Reporter: Jieshan Bean
Assignee: Jieshan Bean
Fix For: 0.90.5
Before I explain why it could happen, I describe how does this
test(testLogRollOnDatanodeDeath) works:
1. There's two datanodes A & B in env. So the log has two replications first
which is the expect and default value.
2. Add a new datanode C and wait it active.
3. Kill A who is in the pipelines.
4. Write data. So trigger a new rollWriter while the next sync. And it only
happens once. For the new log has two replications.
5. Kill another datanode B.
6. Write batch data to trigger consecutive rollWriter. So LowReplication-Roller
will be disabled.
7. Add a new datanode D and wait it active.
8. Send a rollWriter request. So expect the new log will has the default
replications.
9. Write batch data. Assert the LogReplication-Roller will be enabled.
Maybe the rollWriter request in step 8 can't be executed affected by the
previous roll requests from step 6. So the current log replication is not the
expect value.
{noformat}
public byte [][] rollWriter() throws FailedLogCloseException, IOException {
// Return if nothing to flush.
if (this.writer != null && this.numEntries.get() <= 0) {
return null;
}
{noformat}
So the following assertion must be safeguarded.
{noformat}
log.rollWriter();
batchWriteAndWait(table, 14, true, 10000);
assertTrue("LowReplication Roller should've been enabled",
log.isLowReplicationRollEnabled());
{noformat}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira