Prevent concurrent direct writes from unsetting kPendingDirectWrite flag

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.0.0-rc0, 6.3.0-rc1
    • Affects Version/s: 6.3.0-rc0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.3
    • Execution Team 2023-02-20, Execution Team 2023-02-06
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      If two direct writes to a single time series bucket race with each other, we could end up releasing the bucket for inserts earlier than expected, and corrupt the bucket contents.

      Consider the following sequence:

      | Update1               | Update2                         | Insert1                         | Insert2                           |
      |-----------------------|---------------------------------|---------------------------------|-----------------------------------|
      | Write to storage      |                                 |                                 |                                   |
      | Set kDirectWriteStart |                                 |                                 |                                   |
      |                       | Write to storage                |                                 |                                   |
      |                       | Set kDirectWriteStart           |                                 |                                   |
      |                       | Abort + unset kDirectWriteStart |                                 |                                   |
      |                       |                                 | Reopen/fetch the bucket into BC |                                   |
      |                       |                                 | ...                             | Insert into the same bucket in BC |
      |                       |                                 |                                 |                                   |
      | Commit                |                                 |                                 |                                   |
      |                       |                                 |                                 | Read doc updated by Update1       |
      |                       |                                 |                                 | Write the stale diff              |             

            Assignee:
            Fausto Leyva (Inactive)
            Reporter:
            Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: