[Cache][Enhancement] Assure sql cache only one version#5793
[Cache][Enhancement] Assure sql cache only one version#5793morningman merged 1 commit intoapache:masterfrom
Conversation
gensrc/proto/internal_service.proto
Outdated
There was a problem hiding this comment.
use optional to make it compatible with old version?
be/src/runtime/cache/result_node.cpp
Outdated
There was a problem hiding this comment.
we need to make it compatible with old version
| _data_size -= (*it)->get_data_size(); | ||
| } | ||
| // clear old cache, and create new cache node | ||
| _partition_map.clear(); |
There was a problem hiding this comment.
The _partition_map save the pointer of PartitionRowBatch, so call clear() will not release to memory used by PartitionRowBatch.
And also I checked the origin code, it seems that the PartitionRowBatch in _partition_map is never released?
There was a problem hiding this comment.
When partition list size is bigger than config::query_cache_max_partition_count, it will call function prune_first() to release some PartitionRowBatch.
There was a problem hiding this comment.
prune_first() is to handle _partition_list, but what ahout _partition_map?
be/src/runtime/cache/result_node.cpp
Outdated
be/src/runtime/cache/result_node.cpp
Outdated
There was a problem hiding this comment.
using debug level maybe better.
9eb6f8f to
61fdb40
Compare
| PartitionRowBatch* part_node = *_partition_list.begin(); | ||
| size_t prune_size = part_node->get_data_size(); | ||
| _partition_list.erase(_partition_list.begin()); | ||
| _partition_map.erase(part_node->get_partition_key()); |
61fdb40 to
391e8a0
Compare
For PR apache#5792. This patch add a new param `cache type` to distinguish sql cache and partition cache. When update sql cache, we make assure one sql key only has one version cache.
## Proposed changes pick from apache#58131 Previously, since clean tablet task was a lightweight operation on the BE, it was assumed that dropping tablets would not cause task backlog. However, online observations showed that tasks were still backlogged, causing the BE to consume a lot of memory. Therefore, tablet deduplication logic was added to prevent task backlog.
Proposed changes
For PR #5792. This patch add a new param
cache typeto distinguish sql cache and partition cache. When update sql cache, we make assure one sql key only has one version cache.Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...