zhannngchen commented on code in PR #24240:
URL: https://github.com/apache/doris/pull/24240#discussion_r1322671968


##########
be/src/olap/memtable_flush_executor.cpp:
##########
@@ -127,13 +138,16 @@ void FlushToken::_flush_memtable(MemTable* memtable, 
int32_t segment_id, int64_t
     int64_t flush_size;
     Status s = _do_flush_memtable(memtable, segment_id, &flush_size);
 
-    if (!s) {
-        LOG(WARNING) << "Flush memtable failed with res = " << s;
-        // If s is not ok, ignore the code, just use other code is ok
-        _flush_status.store(s.code());
+    {
+        std::shared_lock rdlk(_flush_status_lock);
+        if (!_flush_status.ok()) {
+            return;
+        }
     }
-    if (_flush_status.load() != OK) {
-        return;
+    if (!s.ok()) {
+        std::lock_guard wrlk(_flush_status_lock);
+        LOG(WARNING) << "Flush memtable failed with res = " << s;
+        _flush_status = s;

Review Comment:
   should return here?



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