Versions Compared

Key

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

...

  1. 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:
    1. If the size fits the capacity then store the offered buffer data into the Queue. 
    2. Otherwise, stop online CDC:

      1. Persist actual CdcConsumerState with (enabled=false, last send WALPointer)
      2. Write StopOnlineCdcRecord into WAL (use the prepared CdcConsumerState).
      3. Clear the buffer, stop CdcWorker.
  4. Optimization: thread might filter ReadSegments by record type, and store only logical records.

Also, it's possible to stop Online CDC using command in control.sh. In this case it also writes StopOnlineCdcRecord.


Body loop (cdc-worker-thread):

...