Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Capturing from the buffer (transaction threadswal-sync-thread)

  1. In wal-sync-thread (the only reader of mmap WAL), under the lock that synchronizes preparing ReadSegment and rolling the WAL segment, to guarantee there are no changes in the underlying buffer.
  2. Offers a deep copy of flushing ReadSegments to the CdcWorker.
  3. CdcWorker checks remaining capacity and the buffer size
  4. If the size fits the capacity then store the offered buffer data into the Queue. 
  5. Otherwise: 
    1. remove from the queue tail segments to free space for the offered buffer
    2. store the head of the offered buffer as nextHead (WALPointer)
    3. It captures data from the Queue while nextHead is not reached.
    4. Switch to the archiveMode.

...