Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-9612

Runtime filter wait longer than it should be

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Impala 4.0.0, Impala 3.4.1
    • Backend
    • None
    • ghx-label-4

    Description

      In one of my query profile, I found an info string like this:
      Runtime filters: All filters arrived. Waited 59s783ms. Maximum arrival delay: 15s296ms.
      If all runtime filters arrived within 15s296ms, then it should not wait until 59s783ms to proceed.

      Looking at runtime-filter.cc, It looks like there is a potential race condition in function RuntimeFilter::WaitForArrival().
      bool RuntimeFilter::WaitForArrival(int32_t timeout_ms) const {
      unique_lock<mutex> l(arrival_mutex_);
      while (arrival_time_.Load() == 0)

      { int64_t ms_since_registration = MonotonicMillis() - registration_time_; int64_t ms_remaining = timeout_ms - ms_since_registration; if (ms_remaining <= 0) break; arrival_cv_.WaitFor(l, ms_remaining * MICROS_PER_MILLI); }

      return arrival_time_.Load() != 0;
      }
      Between checking arrival_time_.Load() and calling arrival_cv_.WaitFor(), arrival_cv_ might be already signaled by either RuntimeFilter::SetFilter() or RuntimeFilter::Cancel() because they do not acquire arrival_mutex_ first.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rizaon Riza Suminto
            rizaon Riza Suminto
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment