gitbitex / gitbitex-spot

An Open Source Cryptocurrency Exchange
https://gitbitex.com:8080/trade/BTC-USDT
487 stars 252 forks source link

进程崩溃,且快照没保存的情况 #24

Open ablewolf opened 4 years ago

ablewolf commented 4 years ago

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.

Originally posted by @greensheng in https://github.com/gitbitex/gitbitex-spot/issues/11#issuecomment-545828540

我发现在orderBook中,seq要超过10000才回去保存一次快照,下次恢复的时候,快照很有可能和kafka对应不上,怎么办呢?