yiguolei commented on code in PR #45743: URL: https://github.com/apache/doris/pull/45743#discussion_r1894593201
########## be/src/olap/memtable_flush_executor.cpp: ########## @@ -140,6 +141,36 @@ Status FlushToken::wait() { return Status::OK(); } +Status FlushToken::_try_reserve_memory(int64_t size) { + auto* thread_context = doris::thread_context(); + auto* memtable_flush_executor = + ExecEnv::GetInstance()->storage_engine().memtable_flush_executor(); + Status st; + do { + // only try to reserve process memory + st = thread_context->reserve_memory(size); + if (st.ok()) { + memtable_flush_executor->inc_flushing_task(); + break; + } + if (_is_shutdown()) { + st = Status::Cancelled("flush memtable already cancelled"); + break; + } + // Make sure at least one memtable is flushing even reserve memory failed. + if (memtable_flush_executor->check_and_inc_has_any_flushing_task()) { + // If there are already any flushing task, Wait for some time and retry. + LOG(INFO) << fmt::format( Review Comment: 这个每1min 打印一次吧,否则内存满的时候刷屏了 -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org