-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-24079 [Flakey Tests] Misc fixes and debug; fix BindException in… #1388
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 |
---|---|---|
|
@@ -78,7 +78,7 @@ public void testMultiThreadedGetClusterId() throws Exception { | |
Configuration conf = TEST_UTIL.getConfiguration(); | ||
CachedClusterId cachedClusterId = new CachedClusterId(conf); | ||
TestContext context = new TestContext(conf); | ||
int numThreads = 100; | ||
int numThreads = 16; | ||
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. oops my bad.. thanks for lowering it. |
||
for (int i = 0; i < numThreads; i++) { | ||
context.addThread(new GetClusterIdThread(context, cachedClusterId)); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
@@ -46,9 +45,13 @@ | |
import org.junit.ClassRule; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
@Category(LargeTests.class) | ||
public class TestServerSideScanMetricsFromClientSide { | ||
private static final Logger LOG = | ||
LoggerFactory.getLogger(TestServerSideScanMetricsFromClientSide.class); | ||
|
||
@ClassRule | ||
public static final HBaseClassTestRule CLASS_RULE = | ||
|
@@ -178,22 +181,27 @@ private void testRowsSeenMetric(boolean async) throws Exception { | |
baseScan = new Scan(); | ||
baseScan.setScanMetricsEnabled(true); | ||
baseScan.setAsyncPrefetch(async); | ||
testRowsSeenMetric(baseScan); | ||
|
||
// Test case that only a single result will be returned per RPC to the serer | ||
baseScan.setCaching(1); | ||
testRowsSeenMetric(baseScan); | ||
|
||
// Test case that partial results are returned from the server. At most one cell will be | ||
// contained in each response | ||
baseScan.setMaxResultSize(1); | ||
testRowsSeenMetric(baseScan); | ||
|
||
// Test case that size limit is set such that a few cells are returned per partial result from | ||
// the server | ||
baseScan.setCaching(NUM_ROWS); | ||
baseScan.setMaxResultSize(getCellHeapSize() * (NUM_COLS - 1)); | ||
testRowsSeenMetric(baseScan); | ||
try { | ||
testRowsSeenMetric(baseScan); | ||
|
||
// Test case that only a single result will be returned per RPC to the serer | ||
baseScan.setCaching(1); | ||
testRowsSeenMetric(baseScan); | ||
|
||
// Test case that partial results are returned from the server. At most one cell will be | ||
// contained in each response | ||
baseScan.setMaxResultSize(1); | ||
testRowsSeenMetric(baseScan); | ||
|
||
// Test case that size limit is set such that a few cells are returned per partial result from | ||
// the server | ||
baseScan.setCaching(NUM_ROWS); | ||
baseScan.setMaxResultSize(getCellHeapSize() * (NUM_COLS - 1)); | ||
testRowsSeenMetric(baseScan); | ||
} catch (Throwable t) { | ||
LOG.error("FAIL", t); | ||
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. curious why this? Doesn't junit log this anyway? 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. Debug. Narrowing in on where exception comes up out of. Probably useless. Fell gets desperate. |
||
throw t; | ||
} | ||
} | ||
|
||
public void testRowsSeenMetric(Scan baseScan) throws Exception { | ||
|
@@ -212,7 +220,8 @@ public void testRowsSeenMetric(Scan baseScan) throws Exception { | |
scan = new Scan(baseScan); | ||
scan.withStartRow(ROWS[i - 1]); | ||
scan.withStopRow(ROWS[ROWS.length - 1]); | ||
testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, ROWS.length - i); | ||
testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_SCANNED_KEY_METRIC_NAME, | ||
ROWS.length - i); | ||
} | ||
|
||
// The filter should filter out all rows, but we still expect to see every row. | ||
|
@@ -318,8 +327,11 @@ public void testRowsFilteredMetric(Scan baseScan) throws Exception { | |
public void testRowsFilteredMetric(Scan baseScan, Filter filter, int expectedNumFiltered) | ||
throws Exception { | ||
Scan scan = new Scan(baseScan); | ||
if (filter != null) scan.setFilter(filter); | ||
testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME, expectedNumFiltered); | ||
if (filter != null) { | ||
scan.setFilter(filter); | ||
} | ||
testMetric(scan, ServerSideScanMetrics.COUNT_OF_ROWS_FILTERED_KEY_METRIC_NAME, | ||
expectedNumFiltered); | ||
} | ||
|
||
/** | ||
|
@@ -334,7 +346,7 @@ public void testMetric(Scan scan, String metricKey, long expectedValue) throws E | |
ResultScanner scanner = TABLE.getScanner(scan); | ||
// Iterate through all the results | ||
while (scanner.next() != null) { | ||
|
||
continue; | ||
} | ||
scanner.close(); | ||
ScanMetrics metrics = scanner.getScanMetrics(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,17 @@ private static String generateDummyMastersList(int size) { | |
@Test public void testRegistryRPCs() throws Exception { | ||
Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); | ||
HMaster activeMaster = TEST_UTIL.getHBaseCluster().getMaster(); | ||
for (int numHedgedReqs = 1; numHedgedReqs <=3; numHedgedReqs++) { | ||
final int size = activeMaster.getMetaRegionLocationCache(). | ||
getMetaRegionLocations().get().size(); | ||
// Add wait on all replicas being assigned before proceeding w/ test. Failed on occasion | ||
// because not all replicas had made it up before test started. | ||
TEST_UTIL.waitFor(10000, | ||
() -> { | ||
try (MasterRegistry registry = new MasterRegistry(conf)) { | ||
return registry.getMetaRegionLocations().get().size() >= size; | ||
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. this looks always true since the registry actually gets the count from activeMaster.getMetaRegionLocationCache()? I think the check should look something like activeMaster.getLocations().size() == NUM_REPLICAS? Actually we have a utility for this somewhere..I'm not able to find it now..:( 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. You'd know better. There is no getLocations. What you think you were referring to? 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. Found it ..RegionReplicaTestHelper#waitUntilAllMetaReplicasAreReady().. sorry for the typo..the condition should be something like the above method..(I also fixed an edge case there to make the check tighter).. |
||
} | ||
}); | ||
for (int numHedgedReqs = 1; numHedgedReqs <= 3; numHedgedReqs++) { | ||
if (numHedgedReqs == 1) { | ||
conf.setBoolean(HConstants.MASTER_REGISTRY_ENABLE_HEDGED_READS_KEY, false); | ||
} else { | ||
|
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.
nit: Add a jira reference?
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.
Well, turns out the IndexOutOfBoundsException is thrown by a TestCompaction fail-checking test (?). Subsequent patch changes the test to make it plain when test throwing one of these. I think I've seen this in production too. When get more detail, will file JIRA.