Skip to content

Cache sort blocks by the sort owners to avoid contention in shared cache of sorts blocks.#7671

Merged
hvlad merged 2 commits intomasterfrom
work/SortBlocksCache
Jul 10, 2023
Merged

Cache sort blocks by the sort owners to avoid contention in shared cache of sorts blocks.#7671
hvlad merged 2 commits intomasterfrom
work/SortBlocksCache

Conversation

@hvlad
Copy link
Copy Markdown
Member

@hvlad hvlad commented Jul 9, 2023

If request performs many sorts while executing, it often uses shared cache of sort blocks (maintained at dbb-level).
When such requests run concurrently, its creates a big load on shared cache and wait for each other significant time, reducing common performance.

This problem present at SS architecture only.

The offered solution is to avoid return of used sort block into shared common cache until requiest finished its execution.

@hvlad hvlad requested a review from dyemanov July 9, 2023 11:06
@hvlad hvlad self-assigned this Jul 9, 2023
Comment thread src/jrd/sort.h Outdated
Comment thread src/jrd/sort.cpp Outdated
Copy link
Copy Markdown
Member

@dyemanov dyemanov left a comment

Choose a reason for hiding this comment

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

Approved with a couple of minor comments.

@hvlad hvlad merged commit 85716f7 into master Jul 10, 2023
@hvlad hvlad deleted the work/SortBlocksCache branch July 12, 2023 07:16
hvlad added a commit that referenced this pull request Apr 2, 2024
…e from backup (FB5, RC2)

Don't use common SortOwner for sorts with different dbb's.
After #7671 it could contain cached sort buffers from different pools (dbb_permanent) and then release it to the wrong dbb_sort_buffers making possible usage of deallocated memory later.
hvlad added a commit that referenced this pull request Apr 3, 2024
…e from backup (FB5, RC2)

Don't use common SortOwner for sorts with different dbb's.
After #7671 it could contain cached sort buffers from different pools (dbb_permanent) and then release it to the wrong dbb_sort_buffers making possible usage of deallocated memory later.
dyemanov pushed a commit that referenced this pull request Nov 16, 2024
…e from backup (FB5, RC2)

Don't use common SortOwner for sorts with different dbb's.
After #7671 it could contain cached sort buffers from different pools (dbb_permanent) and then release it to the wrong dbb_sort_buffers making possible usage of deallocated memory later.
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