lingbin opened a new pull request #2881: Improve the triggering strategy of BE 
report
URL: https://github.com/apache/incubator-doris/pull/2881
 
 
   Currently, the report from BE to FE is completed in the background
   threads of `AgentServer` (`report_tablet_thread` and
   `report_disk_stat_thread`).  These two threads will sleep and be in
   a standby state after each report, if there is any need to report
   immediately, they will be notified and wake up immediately to report.
   
   For example, when background thread (`disk_monitor_thread`) in
   `StorageEngine` finds some tablets were deleted, it will notify
   `AgentServer` to trigger a report immediately.
   
   In the current implementation, in order to report ASAP, a local variable
   (`_is_drop_tables`) and two other flags are used to record whether
   reporting is needed, and then `StorageEngine::disk_monitor_thread` checks
   the value of this variable every time it runs, to determine whether it
   needs to be triggered Reporting. This is actually superfluous, and it
   may result in untimely notifications, as shown below:
   
   ```
   (thread_1)        (thread_2)
   disk-monitor     disk-stat-reporter
       |                  |
       |               reporting
       |                  |
     notify_1             |
       |                  |
       |                wait_for_notify(will wait until timeout or next 
notification)
       |                  |
       V                  V
   ```
   
   When `report_tablet_thread` has not started waiting,
   `StorageEngine::disk_monitor_thread` triggers a notification, so this
   notification will not be received by `report_tablet_thread`,
   resulting in the BE not reporting to the FE until the lock times out
   or the next round of `disk_monitor_thread` detection.
   
   This change restructures the triggering implementation, and solves the above 
problem.
   
   This change also changes some methods(that do not need to be public) to 
private.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to