...
IgniteConfiguration#OnlineCdcConfiguration
- CdcConsumer, keepBinary.DataStorageConfiguration#onlineCdcBufSize
- by default (walSegments * walSegmentSize). it’s now 640 MB by default. - All non-archived segments are fitted in memory. If OnlineCDC requires more space than it, it looks like ordinary CDC process should be used instead.
DataRegionConfiguration#cdcMode
- BACKGROUND, ONLINE (default is BACKGROUND)BACKGROUND
- make hard links of archived segments into cdc directory, that is watched by the background ignite-cdc process.ONLINE
- OnlineCDC enabled + still do BACKGROUND job (ignite-cdc runs in BACKUP mode)mode job.
- Logs:
- initialization (amount of records read during the restore)
- failure
- buffer is full
- Metrics:
- ordinary cdc metrics (count of wal segments, wal entries)
- current buffer size
- status of CDC (on/off)
- last committed WALPointer
- lag between buffer and WAL archive (segments)
- lag between WAL and CDC consumer (milliseconds).
...
Online capturing of WALRecords
Entrypoint for WALRecords to be captured by CDC. Options are:
SegmentedRingByteBuffer
(represents WAL segment) is During read of SegmentedRingByteBuffer after fsync is invoked. It is a multi-producer/single-consumer data structure, then the only place to built-in is read operations (invoked at the moment of fsync).
- + Relying on the consumer workflow we can guarantee order of events.
- + Consumer is a background thread, capturing records doesn't affect performance of transactional threads
- - Can't No opportunity to filter physical records at the entrypoint (might waste the buffer space). Must deserialize and Will filter them later before actual sending to a CdcConsumer.
- - The consumer is triggered by a schedule - every 500ms by default.
- - Logic has some differences depending on the WAL settings (mmap true/false, FULL_SYNC)
- Capturing in
FileWriteAheadLogManager#log(WALRecord).
- + Capture logical records only
- + Common logic for all WAL settings
- - Captures record in buffer in transactional threads - might affect performance
- - CDC process must sort events by WALPointer by self - maintain concurrent ordering data structure, and implementing waiting for closing WAL gaps before sending.
- - Send events before they actually flushed in local Ignite node - lead to inconsistency between main and stand-by clusters.
First option is proposed to use.
CdcWorker
CdcWorker is a thread responsible for collecting WAL records, transforming them to CdcEvents
and submitting them to a CdcConsumer
. The worker collects records in the queue.
...