You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/09 07:24:15 UTC

[GitHub] [incubator-doris] morningman commented on a diff in pull request #10007: [Bugfix](load) fix streamload failure due to false unhealthy replica in concurrent stream load

morningman commented on code in PR #10007:
URL: https://github.com/apache/incubator-doris/pull/10007#discussion_r893158734


##########
be/src/olap/tablet.cpp:
##########
@@ -1290,7 +1295,23 @@ void Tablet::build_tablet_report_info(TTabletInfo* tablet_info) {
     Version max_version;
     bool has_version_cross;
     _max_continuous_version_from_beginning_unlocked(&cversion, &max_version, &has_version_cross);
-    tablet_info->__set_version_miss(cversion.second < max_version.second);
+    if (enable_consective_missing_check) {
+        if (cversion.second < max_version.second) {
+            if (_last_missed_version == cversion.second + 1) {
+                if (_last_missed_time_s - MonotonicSeconds() >= 60) {
+                    // version missed for over 60 seconds
+                    tablet_info->__set_version_miss(true);
+                    _last_missed_version = -1;
+                    _last_missed_time_s = 0;
+                }
+            } else {
+                _last_missed_version = cversion.second + 1;
+                _last_missed_time_s = MonotonicSeconds();
+            }
+        } else {

Review Comment:
   This `else` block should be with `if (enable_consective_missing_check) {`



##########
be/src/olap/tablet.cpp:
##########
@@ -1277,7 +1279,10 @@ bool Tablet::_contains_rowset(const RowsetId rowset_id) {
     return false;
 }
 
-void Tablet::build_tablet_report_info(TTabletInfo* tablet_info) {
+// need check if consective version missing in full report
+// alter tablet will ignore this check
+void Tablet::build_tablet_report_info(TTabletInfo* tablet_info,
+                                      bool enable_consective_missing_check) {

Review Comment:
   ```suggestion
                                         bool enable_consecutive_missing_check) {
   ```



##########
be/src/olap/tablet.cpp:
##########
@@ -1290,7 +1295,23 @@ void Tablet::build_tablet_report_info(TTabletInfo* tablet_info) {
     Version max_version;
     bool has_version_cross;
     _max_continuous_version_from_beginning_unlocked(&cversion, &max_version, &has_version_cross);
-    tablet_info->__set_version_miss(cversion.second < max_version.second);
+    if (enable_consective_missing_check) {
+        if (cversion.second < max_version.second) {
+            if (_last_missed_version == cversion.second + 1) {
+                if (_last_missed_time_s - MonotonicSeconds() >= 60) {
+                    // version missed for over 60 seconds
+                    tablet_info->__set_version_miss(true);
+                    _last_missed_version = -1;
+                    _last_missed_time_s = 0;
+                }
+            } else {
+                _last_missed_version = cversion.second + 1;
+                _last_missed_time_s = MonotonicSeconds();
+            }
+        } else {

Review Comment:
   And please add comment here to explain why we need this logic



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org