Skip to content

Writing match log to kafka is not robust #11

Closed

Description

@yihuang

I think current way of writing to kafka is not robust, in case of match engine crash, some log messages not yet written into kafka successfully may lost.

Activity

  1. greensheng commented on Oct 24, 2019

    @greensheng
    Member

    We have considered the case of process crash. Through the snapshot mechanism to ensure that any log will not be lost, when the process is restarted, a snapshot recovery will be done. Therefore, there will be no data loss, but duplicate logs will be generated.

  2. yihuang commented on Oct 24, 2019

    @yihuang
    Author

    Thanks for your reply and work. Let me elaborate a bit:
    1、Do you ensure that when snapshotting, all the messages produced to kafka get acked?
    2、AFAIK kafka producer doesn't guarantee message order, does that impact the following processes.

  3. greensheng commented on Oct 24, 2019

    @greensheng
    Member

    Thanks for your reply and work. Let me elaborate a bit:
    1、Do you ensure that when snapshotting, all the messages produced to kafka get acked?
    2、AFAIK kafka producer doesn't guarantee message order, does that impact the following processes.

    1,Yes, We use synchronous write to submit logs, writing 1000 logs at a time.When we save the snapshot, we will first check whether the snapshot.logSeq has been submitted to Kafka.
    2,Only one partition is used for each log topic, so the sequence can be guaranteed.

  4. yihuang commented on Oct 24, 2019

    @yihuang
    Author

    2, The retry behavior in the producer side will change the order of messages.

  5. greensheng commented on Oct 24, 2019

    @greensheng
    Member

    2, The retry behavior in the producer side will change the order of messages.

    Log producer is synchronous and single thread, and there will be no concurrent submission.

  6. greensheng commented on Oct 25, 2019

    @greensheng
    Member

    I see what you mean. I read the source code of Kafka go. Retrying really leads to the order not being guaranteed.

    At present, if the log consumer finds the log.seq discontinuity, it will terminate the process.

    Do you think enable. idempotence can solve this problem?

  7. yihuang commented on Oct 25, 2019

    @yihuang
    Author

    Yes, enable.idempotence = true suppose to solve this, if kafka go is a binding to librdkafka.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions