github-actions[bot] commented on code in PR #63940:
URL: https://github.com/apache/doris/pull/63940#discussion_r3388103786


##########
cloud/src/recycler/recycler.cpp:
##########
@@ -96,6 +96,15 @@ void sleep_for_packed_file_retry() {
     
std::this_thread::sleep_for(std::chrono::milliseconds(packed_file_retry_sleep_ms()));
 }
 
+bool filter_out_instance(const std::string& instance_id) {
+    if (config::recycle_whitelist.empty()) {

Review Comment:
   This reads the now-mutable `recycle_whitelist` / `recycle_blacklist` vectors 
directly from the scanner thread, while `/update_config` can assign new 
`std::vector<std::string>` values through `do_set_config`. `std::vector` does 
not support concurrent read/write; an update can reallocate while this code 
calls `empty()`, `find()`, or `end()`, which is undefined behavior. Please 
publish an immutable snapshot or take a shared lock here and the matching 
unique lock in the vector update path before making these configs mutable.



##########
cloud/src/common/config.h:
##########
@@ -96,9 +96,9 @@ CONF_mInt64(compacted_rowset_retention_seconds, "10800");  // 
3h
 CONF_mInt64(dropped_index_retention_seconds, "10800");     // 3h
 CONF_mInt64(dropped_partition_retention_seconds, "10800"); // 3h
 // Which instance should be recycled. If empty, recycle all instances.
-CONF_Strings(recycle_whitelist, ""); // Comma seprated list
+CONF_mStrings(recycle_whitelist, ""); // Comma seprated list

Review Comment:
   Making these filters mutable leaves `Checker` with stale values: 
`Checker::start()` still copies `config::recycle_whitelist` / 
`config::recycle_blacklist` into `instance_filter_` once, and both checker scan 
and inspect paths use that cached set. With `enable_checker=true`, updating the 
filter now changes recycler scheduling but checker continues 
scheduling/checking the old instance set until restart. Please make `Checker` 
use the same dynamic snapshot, or otherwise keep the runtime update from 
creating divergent behavior between the two components.



-- 
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]

Reply via email to