teamconfx commented on issue #6043:
URL: https://github.com/apache/accumulo/issues/6043#issuecomment-3722852514
This issue is very time sensitive and only happens if the restart and
retrieve time window is extremely small.
If you cannot reproduce it, try to modify the existing
`SummaryIT.testPermissions()` test to add a tablet server restart after flush.
The following test reproduces the issue (with ~40% failure occurance):
```java
@Test
public void testSummaryAfterRestart() throws Exception {
final String table = getUniqueNames(1)[0];
try (AccumuloClient c =
Accumulo.newClient().from(getClientProps()).build()) {
// Create table with summarization enabled
NewTableConfiguration ntc = new NewTableConfiguration();
SummarizerConfiguration sc1 =
SummarizerConfiguration.builder(FooCounter.class).build();
ntc.enableSummarization(sc1);
c.tableOperations().create(table, ntc);
// Write data
try (BatchWriter bw = c.createBatchWriter(table)) {
write(bw, "bar1", "f1", "q1", "v1");
write(bw, "bar2", "f1", "q1", "v2");
write(bw, "foo1", "f1", "q1", "v3");
}
// Flush to ensure summaries are generated
c.tableOperations().flush(table, null, null, true);
// Verify summaries exist before restart
List<Summary> beforeRestart =
c.tableOperations().summaries(table).retrieve();
assertEquals(1, beforeRestart.size()); // PASSES
// Gracefully restart a tablet server
MiniAccumuloClusterImpl cluster = (MiniAccumuloClusterImpl) getCluster();
List<Process> tservers =
cluster.getProcesses().get(ServerType.TABLET_SERVER);
Process tserver = tservers.get(0);
// Stop the tablet server gracefully
cluster.killProcess(ServerType.TABLET_SERVER, tserver);
// Start a new tablet server
cluster.exec(TabletServer.class);
// Wait for cluster to stabilize
cluster.waitForAllCompactionsToFinish();
// Immediately try to retrieve summaries - THIS FAILS INTERMITTENTLY
List<Summary> afterRestart =
c.tableOperations().summaries(table).retrieve();
// BUG: afterRestart.size() is sometimes 0 when it should be 1
// This causes IndexOutOfBoundsException when accessing get(0)
Summary summary = afterRestart.get(0); // throws
IndexOutOfBoundsException ~40% of time
assertEquals(2, summary.getStatistics().size());
assertEquals(2L, (long) summary.getStatistics().getOrDefault("bars",
0L));
assertEquals(1L, (long) summary.getStatistics().getOrDefault("foos",
0L));
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]