Versions Compared

Key

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

...

  1. Configure Ignite to enable OnlineCDC.
  2. Configure ignite-cdc process .(set BACKUP mode in CdcConfiguration)
  3. Start Ignite cluster in ACTIVE_READ_ONLY mode.
  4. Start background process ignite-cdc in BACKUP mode.
    1. ./ignite-cdc.sh –backupcdc-config.xml
  5. Explicit start OnlineCDC on Ignite:
    1. ./control.sh –cdc online –start
  6. Move Ignite cluster to ACTIVE state.

Ignite node restart after failure:

...

Note, that ignite-cdc.sh can be run in 2 modes - BACKUP, ACTIVE (default):

  1. BACKUP is used as backup process for OnlineCDC, and then such process may fetch CDC configuration from IgniteConfiguration. Case is async replication between master and stand-by clusters.
  2. ACTIVE is used as independent process that doesn’t rely on OnlineCDC, has its own configuration. Case is filling a cold data lake.

Ignite node restart after failure:

  1. Start Ignite node as usual (OnlineCDC automatically recovers itself, ignite-cdc waits for the recovering)

Stop OnlineCDC and use ignite-cdc Stop OnlineCDC and use ignite-cdc instead:

  1. Explicit stop OnlineCDC on Ignite (ignite-cdc automatically switches to active mode and starts capturing) 
    1. ./control.sh –cdc online –stop

...

  1. Explicit stop ignite-cdc.sh
  2. Explicit stop OnlineCDC

User interface

Ignite

  1. IgniteConfiguration#CdcConsumer - from extensions (kafka, thin client)IgniteConfiguration#OnlineCdcConfiguration - CdcConsumer, keepBinary.
  2. DataStorageConfiguration#onlineCdcBufSize - by default (walSegments * walSegmentSize). it’s now 640 MB by default.
    1. 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.
    DataStorageConfiguration#onlineCdcKeepBinary - default true
    1. .
  3. DataRegionConfiguration#cdcMode - BACKGROUND, ONLINE (default is BACKGROUND)
    1. BACKGROUND - make hard links of archived segments into cdc directory, that is watched by the background ignite-cdc process.
    2. ONLINE - OnlineCDC enabled + do BACKGROUND job (ignite-cdc runs in BACKUP mode).
  4. Logs: 
    1. initialization (amount of records read during the restore)
    2. failure 
    3. buffer is full
  5. Metrics: 
    1. ordinary cdc metrics (count of wal segments, wal entries)
    2. current buffer size
    3. status of CDC (on/off)
    4. last committed WALPointer
    5. lag between buffer and WAL archive (segments)
    6. lag between WAL and CDC consumer (milliseconds).

ignite-cdc

    1. WAL and CDC consumer (milliseconds).

ignite-cdc

  1. CdcConfiguration#mode - ACTIVE, BACKUP (default ACTIVE)
  2. CdcConfiguration#modeOnStart - ACTIVE, BACKUP (default ACTIVE)
    1. ACTIVE - ignite-cdc sends data from cdc dir to consumer
    2. BACKUP - ignite-cdc polls Ignite OnlineCDC metrics, clears cdc dir from hardlinks, starts working in ACTIVE mode after OnlineCDC fails. If Ignite node fails ignite-cdc waits for it to start to check OnlineCDC status.
  3. CdcConfiguration#checkOnlineFrequency - period of polling metrics of OnlineCDC from Ignite to make sure it still works, and clean obsolete links from cdc dir.
  4. Logs: 
  5. check of online cdc metrics,
  6. Logs: 
      1. clearing cdc dir, switch state.
    1. Metrics:
      1. current state.

    control.sh

    1. CdcOnline subcommand - enable/disable.

    ...

    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, write StopOnlineCdcRecord to WAL.
    4. Optimization: thread might filter ReadSegments by record type, and store only logical records.

    Body loop (cdc-worker-thread):

    1. Checks metadata (mappings, binary_meta, caches), prepare updates if any.
    2. polls queuethe Queue, transforms ReadSegment data to Iterator<CdcEvent>, pushes them to CdcConsumer, pushes them to CdcConsumer.
    3. If CdcConsumer#onEvents returns true:
      1. Persists CdcConsumerState.
      2. Write OnlineCdcRecord record to WAL with the WALPointer.
    4. Optimization: transform segment buffers to CdcEvents in background (to reduce the buffer usage). CdcConsumer should be async then?

    ignite-cdc in BACKUP mode

    1. Parses WAL records, looking for OnlineCdcRecord and StopOnlineCdcRecord
    2. For OnlineCdcRecord - clears obsolete links from CDC directory
    3. For StopOnlineCdcRecord - switch to ACTIVE mode, start capturing from the last WALPointer (from previous OnlineCdcRecord)Persists CdcConsumerState. Commit the progress on CdcConsumer#onEvents returns true.

    Meta Storage

    1. Online CDC status - ON / OFF
    2. Committed pointer (confirmed by CdcConsumer).

    ...