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

Explicitly cleanup SqlTask on worker when no longer needed #24728

Conversation

losipiuk
Copy link
Member

Currently SqlTask objects are removed from SqlTaskManager.tasks map (cache) after timeout (15 minutes by default). Even though the object is not huge, we observed increased memory pressure up to OOM on busy clusters.

With this PR entries are dropped form SqlTaskManager as soon as they are no longer needed, when coordinator will no longer query for the information

Note: I this code is prone to race condition if last worker to acknowlege task results retransmits acknowlegement. There is a chance that a this point task is already cleaned by cleanup request from coordinator, and entry will get resurected in tasks cache map. This should be extremly rare though, and not cause any problems.

@sopel39
Copy link
Member

sopel39 commented Jan 16, 2025

There is a separate fetcher for dynamic filters. Are you sure these are not cleaned before coordinator fetches DFs? CC @raunaqmorarka . Consider running benchmarks too

@losipiuk losipiuk force-pushed the lukaszos/explicitly-cleanup-sqltask-on-worker-when-no-longer-needed-43dc5e branch from 275bc50 to ec05e54 Compare January 16, 2025 17:10
@@ -124,6 +128,7 @@ public synchronized void updateDynamicFiltersVersionAndFetchIfNecessary(long new
private synchronized void stop()
{
running = false;
remoteTaskCleaner.markDynamidFilterFetcherStopped();
Copy link
Member

Choose a reason for hiding this comment

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

Dynamid -> Dynamic

@losipiuk losipiuk closed this Jan 16, 2025
@losipiuk losipiuk force-pushed the lukaszos/explicitly-cleanup-sqltask-on-worker-when-no-longer-needed-43dc5e branch from c0dab07 to ec05e54 Compare January 16, 2025 17:11
Copy link
Member

@sopel39 sopel39 left a comment

Choose a reason for hiding this comment

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

comment

@losipiuk
Copy link
Member Author

Sorry - moved to #24729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants