decrements total queued mutation size when update idles#5236
Merged
keith-turner merged 1 commit intoapache:2.1from Jan 8, 2025
Merged
decrements total queued mutation size when update idles#5236keith-turner merged 1 commit intoapache:2.1from
keith-turner merged 1 commit intoapache:2.1from
Conversation
Contributor
Author
|
Not sure how to test this. I plan to manually test it using the added logging before merging. |
Contributor
Author
|
Manually tested this using this following test. public class TmpIT extends AccumuloClusterHarness {
@Override
public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
// cfg.setProperty(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX, "10");
cfg.setProperty(Property.TSERV_UPDATE_SESSION_MAXIDLE, "10s");
}
@Test
public void testUnclosedUpdateSessionsions() throws Exception {
String table = getUniqueNames(1)[0];
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
c.tableOperations().create(table);
Random rand = new Random();
for (int i = 0; i < 100; i++) {
var ctx = (ClientContext) c;
var tableId = ctx.getTableId(table);
var extent = new KeyExtent(tableId, null, null);
var tabletMetadata = ctx.getAmple().readTablet(extent, TabletMetadata.ColumnType.LOCATION);
var location = tabletMetadata.getLocation();
assertNotNull(location);
assertEquals(TabletMetadata.LocationType.CURRENT, location.getType());
TabletClientService.Iface client =
ThriftUtil.getClient(ThriftClientTypes.TABLET_SERVER, location.getHostAndPort(), ctx);
// Make the same RPC calls made by the BatchWriter, but pass a corrupt serialized mutation
// in
// this try block.
try {
TInfo tinfo = TraceUtil.traceInfo();
long sessionId = client.startUpdate(tinfo, ctx.rpcCreds(), TDurability.DEFAULT);
byte row[] = new byte[32];
int valSize = rand.nextInt(900)+100;
byte value[] = new byte[valSize];
rand.nextBytes(row);
rand.nextBytes(value);
client.applyUpdates(tinfo, sessionId, extent.toThrift(),
List.of(createTMutation(Base64.getEncoder().encodeToString(row),
Base64.getEncoder().encodeToString(value))));
// not closing update session, this will cause it to idle out on the server side.
} finally {
ThriftUtil.returnClient((TServiceClient) client, ctx);
}
}
UtilWaitThread.sleep(60000);
}
}
}and saw the following in the logs when enabling trace in the config. Those are the last few lines of the cleanup, a lot more were printed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #5235