Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-3768

Implement a tiered back-off in read-while-writer retries

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: sometime
    • Component/s: Cache
    • Labels:
      None

      Description

      There's some code in the current cache layer that attempts to do a tiered back off in reattempting read-while-writer (either for acquiring writer lock or waiting for the first fragment download etc), but, that code is buggy (see below).

      https://github.com/apache/trafficserver/blob/master/iocore/cache/P_CacheInternal.h#L100

      #define VC_SCHED_WRITER_RETRY()                                   \
        do {                                                            \
          ink_assert(!trigger);                                         \
          writer_lock_retry++;                                          \
          ink_hrtime _t = WRITER_RETRY_DELAY;                           \
          if (writer_lock_retry > 2)                                    \
            _t = WRITER_RETRY_DELAY * 2;                                \
          else if (writer_lock_retry > 5)                               \
            _t = WRITER_RETRY_DELAY * 10;                               \
          else if (writer_lock_retry > 10)                              \
            _t = WRITER_RETRY_DELAY * 100;                              \
          trigger = mutex->thread_holding->schedule_in_local(this, _t); \
          return EVENT_CONT;                                            \
        } while (0)
      

      Presently, the retry happens as follows:

      WRITER_RETRY_DELAY, WRITER_RETRY_DELAY, 2*WRITER_RETRY_DELAY, 2*WRITER_RETRY_DELAY, 2*WRITER_RETRY_DELAY etc

      I'm removing the buggy code with TS-3767 to avoid confusion, but, opening this jira per Leif Hedstrom's suggestion to implement a proper tiered back off in the future.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sudheerv Sudheer Vinukonda
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: