Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18209

Reduce binary metadata synchronization time for CDC through Kafka

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • extensions
    • Docs Required, Release Notes Required

    Description

      Currently, when CDC through Kafka is used there are possible delays in replication between clusters when KafkaToIgniteCdcStreamerApplier tries to update binary metadata and marshaller mappings.

      Delays caused by calls of KafkaConsumer#poll in KafkaToIgniteMetadataUpdater#updateMetadata , when meta topic is empty:

      1. When first KafkaToIgniteCdcStreamerApplier meets META_UPDATE_MARKER it calls KafkaToIgniteMetadataUpdater#updateMetadata which in turn calls KafkaConsumer#poll, which returns immediately [1] when data is present in metadata topic. If there are few binary types and mappings to update, first KafkaToIgniteCdcStreamerApplier will consume all entries from metadata topic.
      2. KafkaToIgniteCdcStreamerApplier consequently call KafkaToIgniteMetadataUpdater#updateMetadata for each partition with meta update marker. All further consequent calls will wait for kafkaReqTimeout.
      3. Also there is a bottleneck, when multiple applier threads tries to update metadata and call synchronized method KafkaToIgniteMetadataUpdater#updateMetadata, because KafkaToIgniteMetadataUpdater is shared between applier threads.
      4. Because META_UPDATE_MARKER is sent twice to each Kafka partition of event topic from every node: firstly, in case of type mappings updates, secondly, in case of binary types update there are possible delays up to (clusterSize x topicPartitions x 2 - 1) x kafkaReqTimeout.
      5. Data updates are blocked for Kafka partitions with unprocessed update markers.
      6. For example for default timeout and 16 Kafka partitions last partition will be consumed after 1.5 minutes in case of two one-node clusters.

      Links:

      1. https://kafka.apache.org/27/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#poll-java.time.Duration-

      Attachments

        Issue Links

          Activity

            People

              shishkovilja Ilya Shishkov
              shishkovilja Ilya Shishkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: