Small knowledge of distributed systems: Why is XOR used in the Apche Storm reliability mechanism to judge the integrity of the message?

I remember this question because someone on Zhihu asked
Storm to use the XOR method to judge that the message is completely processed. There have been many introductions on the Internet, but according to the questioner's description, why does it use XOR instead of a counter?
This is the reason why the distributed system needs to consider the asynchronous network transmission model. The order in which the acker receives the bolts is uncertain, and the random numbers used for XOR can be considered as one-to-one correspondence, just like a key opens a lock. If If the increments of +1, -1 are sent, it is easy to repeat. If the order received by the acker is not in physical time order, the early ack of the tuple may occur.
The ideal order may be +1, +1, - 1,-1, once it becomes +1,-1,+1,-1, then after the second number is received, the message will be acked. XOR does not have to worry about this problem

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325346315&siteId=291194637