Skip to content
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

RuntimeException in Tablet.commit does not decrement writes in progress #5208

Open
dlmarion opened this issue Dec 20, 2024 · 0 comments
Open
Labels
bug This issue has been verified to be a bug.
Milestone

Comments

@dlmarion
Copy link
Contributor

Describe the bug
User reported the following stack trace and issue:

java.lang.NegativeArraySizeException: -27
at org.apache.core.data.Mutation.readBytes(Mutation.java:1243)
at org.apache.core.data.Mutation.deserializeColumnUpdate(Mutation.java:1283)
at org.apache.core.data.Mutation.getUpdates(Mutation.java:1267)
at org.apache.tserver.InMemoryMap$DefaultMap.mutate(InMemoryMap.java:434)
at org.apache.tserver.InMemoryMap$SampleMap.mutate(InMemoryMap.java:243)
at org.apache.tserver.InMemoryMap.mutate(InMemoryMap.java:505)
at org.apache.tserver.tablet.CommitSession.mutate(CommitSession.java:117)
at org.apache.tserver.tablet.TabletMemory.mutate(TabletMemory.java:145)
at org.apache.tserver.tablet.Tablet.commit(Tablet.java:880)
at org.apache.tserver.tablet.CommitSession.commit(CommitSession.java:86)

in the Tablet.commit code:

public void commit(CommitSession commitSession, List<Mutation> mutations) {
int totalCount = 0;
long totalBytes = 0;
// write the mutation to the in memory table
for (Mutation mutation : mutations) {
totalCount += mutation.size();
totalBytes += mutation.numBytes();
}
getTabletMemory().mutate(commitSession, mutations, totalCount);
synchronized (this) {
if (isCloseComplete()) {
throw new IllegalStateException(
"Tablet " + extent + " closed with outstanding messages to the logger");
}
// decrement here in case an exception is thrown below
decrementWritesInProgress(commitSession);
getTabletMemory().updateMemoryUsageStats();
numEntries += totalCount;
numEntriesInMemory += totalCount;
ingestCount += totalCount;
ingestBytes += totalBytes;
}
}

The runtime exception thrown from getTabletMemory().mutate(commitSession, mutations, totalCount); causes the code following to be skipped. This causes the writesInProgress counter to not be decremented, which impacts other Tablet operations.

Versions (OS, Maven, Java, and others, as appropriate):

  • Affected version(s) of this project: 2.1.2
@dlmarion dlmarion added the bug This issue has been verified to be a bug. label Dec 20, 2024
@dlmarion dlmarion added this to the 2.1.4 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue has been verified to be a bug.
Projects
None yet
Development

No branches or pull requests

1 participant