Skip to content

IGNITE-26567 RO scans triggered by SQL query fragments cause memory leaks in inflights tracker#7649

Open
Lalant wants to merge 3 commits intoapache:mainfrom
Lalant:ignite-26567-sql-ro-scans-memory-leak
Open

IGNITE-26567 RO scans triggered by SQL query fragments cause memory leaks in inflights tracker#7649
Lalant wants to merge 3 commits intoapache:mainfrom
Lalant:ignite-26567-sql-ro-scans-memory-leak

Conversation

@Lalant
Copy link
Contributor

@Lalant Lalant commented Feb 24, 2026

testBroadcastQueryTxInflightStateCleanup has never finished. Added markReadOnlyTxFinished call to FinishedTransactionBatchRequestHandler in order to fix issue on nodes different from coordinator.
https://issues.apache.org/jira/projects/IGNITE/issues/IGNITE-26567

…BatchRequestHandler in order to fix issue with tx finish status on nodes different from coordinator.
assertFalse(transactionInflights.hasActiveInflights(), "Expecting no active inflights");

Awaitility.await()
.atMost(Duration.ofSeconds(60))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may reduce this time by running the test with small value of RESOURCE_VACUUM_INTERVAL_MILLISECONDS_PROPERTY (see usages of @WithSystemProperty)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to class

}

private void cleanUpForTransaction(UUID transactionId) {
transactionInflights.markReadOnlyTxFinished(transactionId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really work?
markReadOnlyTxFinished creates new ReadOnlyTxContext if there no context, and marks it as finished. Then, FinishedReadOnlyTransactionTracker scans finished transactions (see FinishedReadOnlyTransactionTracker#broadcastClosedTransactions, TransactionInflights#finishedReadOnlyTransactions ) and finds this context, marked as finished. It broadcasts new FinishedTransactionsBatchMessage and creates the contexts for this transactions on all nodes again.
I think, on message processing it shouldn't be created, and the check in the test should be fixed to make sure the context is removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the test to check that contexts are empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still passing

@Lalant Lalant force-pushed the ignite-26567-sql-ro-scans-memory-leak branch from 70d1dad to cd4a8e4 Compare February 27, 2026 08:52
@Lalant Lalant force-pushed the ignite-26567-sql-ro-scans-memory-leak branch from cd4a8e4 to ed635b0 Compare February 27, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants