github-actions[bot] commented on code in PR #67228:
URL: https://github.com/apache/doris/pull/67228#discussion_r4123678879
##########
be/src/service/point_query_executor.cpp:
##########
@@ -64,6 +65,13 @@
#include "util/thrift_util.h"
namespace doris {
+namespace {
+
+size_t lookup_connection_cache_block_pool_size() {
+ return
static_cast<size_t>(std::max(config::lookup_connection_cache_block_pool_size,
1));
Review Comment:
[P2] Synchronize reads of this live pool-size setting. `DEFINE_mInt32`
stores a plain `int32_t`, and `config::set_config` writes it under
`mutable_string_config_lock`, but this helper reads it without that lock from
point-query worker threads during both cache initialization and block return.
Updating the setting while requests run therefore creates a C++ data race; the
writer's lock does not protect these reads. Use a synchronized/atomic config
snapshot, or make the setting startup-only if live updates are unnecessary.
##########
be/src/service/point_query_executor.cpp:
##########
@@ -212,8 +218,9 @@ void Reusable::return_block(std::unique_ptr<Block>& block) {
}
block->clear_column_data();
_block_pool.push_back(std::move(block));
- if (_block_pool.size() > s_preallocted_blocks_num) {
- _block_pool.resize(s_preallocted_blocks_num);
+ const auto block_pool_size = lookup_connection_cache_block_pool_size();
Review Comment:
[P2] Apply downward live updates to idle cached pools. This is a mutable
config, but the only trim is in `return_block()`. If an operator sets 32, warms
100 prepared contexts, then lowers the value to 1 after requests finish, all
100 idle entries keep their 32 blocks. The NUMBER-cache stale sweep is skipped
at 1024 entries or fewer, so the excess memory can remain indefinitely without
another lookup. Trim cached pools on a downward update, or make this setting
startup-only and document that behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]